Abstract
We reduce JavaScript to a core calculus structured as a small-step operational semantics. We present several peculiarities of the language and show that our calculus models them. We explicate the desugaring process that turns JavaScript programs into ones in the core. We demonstrate faithfulness to JavaScript using real-world test suites. Finally, we illustrate utility by defining a security property, implementing it as a type system on the core, and extending it to the full language.
Keywords
- Type System
- Test Suite
- Typing Rule
- Evaluation Context
- Syntactic Form
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abadi, M., Cardelli, L.: A Theory of Objects. Springer, Heidelberg (1996)
Anderson, C., Giannini, P., Drossopoulou, S.: Towards type inference for JavaScript. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 428–452. Springer, Heidelberg (2005)
Borning, A.: Classes versus prototypes in object-oriented languages. In: ACM Fall Joint Computer Conference (1986)
Chugh, R., Meister, J.A., Jhala, R., Lerner, S.: Staged information flow for JavaScript. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (2009)
Crockford, D.: ADSafe, http://www.adsafe.org
ECMAScript language specification (1999)
Facebook. FBJS, http://wiki.developers.facebook.com/index.php/FBJS
Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press, Cambridge (2009)
Guarnieri, S., Livshits, B.: GateKeeper: Mostly static enforcement of security and reliability policies for JavaScript code. In: USENIX Security Symposium (2009)
Guha, A., Krishnamurthi, S., Jim, T.: Static analysis for Ajax intrusion detection. In: International World Wide Web Conference (2009)
Heidegger, P., Thiemann, P.: Recency types for dynamically-typed, object-based languages: Strong updates for JavaScript. In: ACM SIGPLAN International Workshop on Foundations of Object-Oriented Languages (2009)
Herman, D.: ClassicJavaScript, http://www.ccs.neu.edu/home/dherman/javascript/
Jensen, S.H., Møller, A., Thiemann, P.: Type analysis for JavaScript. In: International Static Analysis Symposium (2009)
Klein, C., Finder, R.B.: Randomized testing in PLT Redex. In: ACM SIGPLAN Workshop on Scheme and Functional Programming (2009)
Maffeis, S., Mitchell, J.C., Taly, A.: An operational semantics for JavaScript. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 307–325. Springer, Heidelberg (2008)
Maffeis, S., Mitchell, J.C., Taly, A.: Isolating JavaScript with filters, rewriting, and wrappers. In: Backes, M., Ning, P. (eds.) ESORICS 2009. LNCS, vol. 5789, pp. 505–522. Springer, Heidelberg (2009)
Miller, M.S., Samuel, M., Laurie, B., Awad, I., Stay, M.: Caja: Safe active content in sanitized JavaScript. Technical report, Google Inc. (2008), http://google-caja.googlecode.com/files/caja-spec-2008-06-07.pdf
Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of Typed Scheme. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2008)
Ungar, D., Smith, R.B.: SELF: The power of simplicity. In: ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages & Applications (1987)
Wright, A., Felleisen, M.: A syntactic approach to type soundness. Information and Computation 115(1) (1994)
Yu, D., Chander, A., Islam, N., Serikov, I.: Javascript instrumentation for browser security. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2007)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Guha, A., Saftoiu, C., Krishnamurthi, S. (2010). The Essence of JavaScript. In: D’Hondt, T. (eds) ECOOP 2010 – Object-Oriented Programming. ECOOP 2010. Lecture Notes in Computer Science, vol 6183. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14107-2_7
Download citation
DOI: https://doi.org/10.1007/978-3-642-14107-2_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-14106-5
Online ISBN: 978-3-642-14107-2
eBook Packages: Computer ScienceComputer Science (R0)