skip to main content
research-article

A tested semantics for getters, setters, and eval in JavaScript

Published:22 October 2012Publication History
Skip Abstract Section

Abstract

We present S5, a semantics for the strict mode of the ECMAScript 5.1 (JavaScript) programming language. S5 shrinks the large source language into a manageable core through an implemented transformation. The resulting specification has been tested against real-world conformance suites for the language. This paper focuses on two aspects of S5: accessors (getters and setters) and eval. Since these features are complex and subtle in JavaScript, they warrant special study. Variations on both features are found in several other programming languages, so their study is likely to have broad applicability.

References

  1. C. Anderson and P. Giannini. Type checking for JavaScript. Electronic Notes in Theoretical Computer Science, 138 (2): 37 -- 58, 2005. Proceedings of the Second Workshop on Object Oriented Developments. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Chugh, J. A. Meister, R. Jhala, and S. Lerner. Staged Information Flow for JavaScript. In Programming Languages Design and Implementation, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. P. Di Gianantonio, F. Honsell, and L. Liquori. A lambda calculus of objects with self-inflicted extension. SIGPLAN Notices, 33 (10): 166--178, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. ECMA International. ECMAScript Edition 5.1. URL http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.p%df.Google ScholarGoogle Scholar
  5. M. Felleisen, R. B. Findler, and M. Flatt. Semantics Engineering with PLT Redex. MIT Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Flatt, S. Krishnamurthi, and M. Felleisen. A programmer's reduction semantics for classes and mixins. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 1998.Google ScholarGoogle Scholar
  7. A. Guha, C. Saftoiu, and S. Krishnamurthi. The Essence of JavaScript. In European Conference on Object-Oriented Programming, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. D. Hedin and A. Sabelfeld. Information-Flow Security Control for JavaScript. In IEEE Computer Security Foundations Symposium, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Heidegger and P. Thiemann. Recency types for dynamically-typed, object based languages: Strong updates for JavaScript. In ACM SIGPLAN International Workshop on Foundations of Object-Oriented Languages, 2009.Google ScholarGoogle Scholar
  10. A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23 (3), 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Maffeis, J. Mitchell, and A. Taly. An Operational Semantics for JavaScript. In ASIAN Symposium on Programming Languages and Systems, pages 307--325, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. S. Miller. The Kernel-E Language Reference Manual. URL http://www.erights.org/elang/elangmanual.pdf.Google ScholarGoogle Scholar
  13. PLT. The Racket Guide. URL http://docs.racket-lang.org/guide/eval.html.Google ScholarGoogle Scholar
  14. C. Queinnec. Macroexpansion Reflective Tower. In Reflection, 1996.Google ScholarGoogle Scholar
  15. A. Taly, Ú. Erlingsson, J. C. Mitchell, M. S. Miller, and J. Nagra. Automated Analysis of Security-Critical JavaScript APIs. In IEEE Symposium on Security and Privacy, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Wand and D. P. Friedman. The Mystery of the Tower Revealed: A Non-Reflective Description of the Reflective Tower. In LISP and Functional Programming, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Yu, A. Chander, N. Islam, and I. Serikov. JavaScript Instrumentation for Browser Security. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A tested semantics for getters, setters, and eval in JavaScript

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 48, Issue 2
          DLS '12
          February 2013
          114 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2480360
          Issue’s Table of Contents
          • cover image ACM Conferences
            DLS '12: Proceedings of the 8th symposium on Dynamic languages
            October 2012
            128 pages
            ISBN:9781450315647
            DOI:10.1145/2384577

          Copyright © 2012 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 22 October 2012

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!