Open aikar opened 10 years ago
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.
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.
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