On the design of the ECMAScript Reflection API


We describe in detail the new reflection API of the upcoming Javascript standard. The most prominent feature of this new API is its support for creating proxies: virtual objects that behave as regular objects, but whose entire “meta-object protocol” is implemented in Javascript itself. Next to a detailed description of the API, we describe a more general set of design principles that helped steer the API’s design, and which should be applicable to similar APIs for other languages. We also describe access control abstractions implemented in the new API, and provide an operational semantics of an extension of the untyped lambda-calculus featuring proxies.