Created
April 27, 2013 21:29
-
-
Save fflorent/5474810 to your computer and use it in GitHub Desktop.
A meta-proxy to debug __exposedProps__ (mozilla-specific) ... brrrrr
This file contains 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
// (sure, just for debugging!) | |
var target = {}; | |
target.__exposedProps__ = new Proxy(Object.freeze({}), | |
new Proxy({ | |
get: function() | |
{ | |
return "rw"; | |
}, | |
getOwnPropertyDescriptor: function() | |
{ | |
return Object.getOwnPropertyDescriptor(commandConsole.__exposedProps__, "log"); | |
}, | |
hasOwn: function() | |
{ | |
return true; | |
}, | |
has: function() | |
{ | |
return true; | |
} | |
}, { | |
get: function(target, name) | |
{ | |
Firebug.Console.log(name); | |
return target[name]; | |
} | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment