node-proxy icon indicating copy to clipboard operation
node-proxy copied to clipboard

official works - node-proxy does not

Open aikar opened this issue 12 years ago • 2 comments

I found this code for handling a general catch all on the global namespace, and it works with node --harmony, but does not with node-proxy

https://gist.github.com/aikar/7094530

TypeError: SetNamedProperty intercepted by non-Proxy object

aikar avatar Oct 22 '13 02:10 aikar

If you would like to see this particular code working, you are going to need to do some more debugging and post it here. Which object is emitting the TypeError? What is the call stack? Does this code get the prototype of the proto object? I don't have the time to debug this one particular use case, but would be happy to help figure out a fix if I can.

samshull avatar Oct 22 '13 16:10 samshull

It's essentially installing a trap on the global object.

Even the code you supply in the example folder also does not work for binding to global.

simply doing global.proto = namespace('foo'); will cause it.

I'm just going to run my app under --harmony, I don't really have the time to debug this myself, haven't touched C++ in like 3-5 years now.

but I figured it being in a fragile state and not working the same as official implementation is a note worthy bug.

aikar avatar Oct 22 '13 23:10 aikar