-
Notifications
You must be signed in to change notification settings - Fork 340
Inconsistent behaviour in vm.runInNewContext()
#478
Comments
Looks like this is because of how we try to create a v8-style context. Within the context, we create a proxy and assign it as the prototype of the global object, but this seems to mean that the While I was playing around with this, I also saw some strange behavior in node-v8:
I think we need to better understand what exactly these contexts do (and what they are supposed to do) and then we might need some upstream chakra changes to try and match v8's behavior. |
Ah nevermind, I was mis-using It seems that the main downfall of our current approach is the fact that the property interceptors are put on the prototype of the global object, rather than the global object itself (which is currently not possible in chakracore). |
I believe that for a proper fix here we'll need to add support for interceptors on the global object / having a proxy as a global object. Without going that far, there are a few stop-gap options I've been considering to handle most of the use-cases:
|
Just noticed that this issue isn't linked to #420 like it should be. |
Still an issue as of |
Still an issue as of |
Still an issue as of |
Problem persists as of |
The test case in mishoo/UglifyJS#2574 uncovers a difference in exceptional behaviour between
node
andnode-chakracore
- here's a reduced test case:test.js
node-chakracore
node
The text was updated successfully, but these errors were encountered: