1.0.0 • Published 7 years ago
jsmirrors v1.0.0
jsmirrors
Mirrors-based reflection interface for JavaScript
Originally based on work by Allen Wirfs-Brock
Files:
- mirrors.js is the reference implementation of the mirror interfaces; supports reflecting over local objects
- doc/interfaces is a specification of the mirror interfaces using an interface description language based on TypeScript with ad hoc extensions for get and set
- tests/harness.html runs a bunch of tests on mirrors.js in-browser; only ever tested in Firefox due to Chrome's restrictions on XHR from local file:// pages
- tests/testRunner-node.js runs the same tests from the command-line using NodeJS
The reference implementation requires a JavaScript implementation that supports ES5. Neither the interface spec nor the implemenation take into account changes made in ES6 and up.
For an introduction to the principles behind mirror-based reflection, read Mirrors: design principles for meta-level facilites of object-oriented programming languages by Gilad Bracha and David Ungar. See also Allen Wirfs-Brock's tour of the original jsmirrors implementation in his posts on reflection in JavaScript.
1.0.0
7 years ago