allenwb / jsmirrors

A prototype mirrors-based refection system for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsmirror - A prototype of a mirrors-based reflection interface for JavaScript

#Files:

  • mirrorsInterfaceSpec.js Specification of the mirror interfaces using an ad hoc interface description language
  • mirrors.js A prototype implementation of the interfaces that supports reflecting over both local and JSON encoded object graphs
  • mtest.html Runs a bunch of tests on mirrors.js. Also use it as usage samples.
  • jsonObjSample.js Test data used by mtest.html and basic description of encoding. It uses a simple JSON-based encoding for a graph of JavaSript objects including property attributes and other metadata.

#Getting started: Run mtest.html to see samples of using jsmirror. Look at the interface definitions in mirrorsInterfaceSpec.js. Read the code.

The mirrors.js prototype requires a JavaScript implementation that supports ES5 functionality. These is limited use of strict mode but in general things will still work without it.

For an introduction to the princples behind mirror based reflection read: Mirrors: design principles for meta-level facilites of object-oriented programming languages by Gilad Bracha and David Ungar.


Allen Wirfs-Brock
April 20, 2011
allen@wirfs-brock.com
allenwb@mozilla.com

About

A prototype mirrors-based refection system for JavaScript


Languages

Language:JavaScript 56.3%Language:HTML 43.7%