Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mschwartz
Forked from oberhamsi/proxytest.js
Created October 5, 2013 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschwartz/6843261 to your computer and use it in GitHub Desktop.
Save mschwartz/6843261 to your computer and use it in GitHub Desktop.
var myObject = {
"foo": true,
"author": "simon",
"env": 123
}
var myProxy = new JavaAdapter(org.mozilla.javascript.NativeObject, {
// The "start" argument is here for setters and getters living
// on a prototype, so they know what to use as "this"-object.
put: function(name, start, value) {
myObject[name] = value;
},
get: function(name, start) {
return myObject[name];
}
});
print(myProxy.author)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment