-
-
Save mschwartz/6843261 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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