Type Analysis for JavaScript

  • Simon Holm Jensen
  • Anders Møller
  • Peter Thiemann
Conference paper

DOI: 10.1007/978-3-642-03237-0_17

Part of the Lecture Notes in Computer Science book series (LNCS, volume 5673)
Cite this paper as:
Jensen S.H., Møller A., Thiemann P. (2009) Type Analysis for JavaScript. In: Palsberg J., Su Z. (eds) Static Analysis. SAS 2009. Lecture Notes in Computer Science, vol 5673. Springer, Berlin, Heidelberg

Abstract

JavaScript is the main scripting language for Web browsers, and it is essential to modern Web applications. Programmers have started using it for writing complex applications, but there is still little tool support available during development.

We present a static program analysis infrastructure that can infer detailed and sound type information for JavaScript programs using abstract interpretation. The analysis is designed to support the full language as defined in the ECMAScript standard, including its peculiar object model and all built-in functions. The analysis results can be used to detect common programming errors – or rather, prove their absence, and for producing type information for program comprehension.

Preliminary experiments conducted on real-life JavaScript code indicate that the approach is promising regarding analysis precision on small and medium size programs, which constitute the majority of JavaScript applications. With potential for further improvement, we propose the analysis as a foundation for building tools that can aid JavaScript programmers.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Simon Holm Jensen
    • 1
  • Anders Møller
    • 1
  • Peter Thiemann
    • 2
  1. 1.Aarhus UniversityDenmark
  2. 2.Universität FreiburgGermany

Personalised recommendations