-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VM context object silently fails on Object.defineProperty #5679
Comments
Duplicate of #5344 ? |
@princejwesley Very likely a duplicate. This is blocking Secure ECMAScript confinement. https://github.com/drses/ses5 |
cc @domenic I am wondering whether you might be able to shine some light on the nature of VM context objects. What is special about the global object in a VM context that might make it hard to freeze properties? |
This seems to work in node 7.x and 8.x, but not in 6.x and 4.x. Sadly, I cannot find the PR / commit which fixed the issue (maybe a v8 bug?). Do we want to backport the fix to 4.x / 6.x? |
There have been several commits that address this but I don't think they can be back-ported because some require extensive changes to V8. I'll go ahead and close this out. People needing this feature should consider upgrading. |
For the sake of completeness: The behavior is fixed with this patch (with some extra V8 changes): |
Okay, I'll reopen pending #13265. (Now that I think about it, I recall this being on track for node 9, not 8.) |
Confirmed that the issue is partially fixed.
|
Fixes: nodejs#2734 Fixes: nodejs#5350 Fixes: nodejs#5679
This is fixed in f1d6b04, see test/parallel/test-vm-global-non-writable-properties.js. |
Confirmed that this is fully fixed in 9.2.1. |
The following script creates a VM context and runs a script that adds a property to that context, redefines that property as immutable, attempts to assign to that property, logs the error if there is one, then logs the value and property descriptor.
Expected behavior (exhibited in Node.js v0.10.36):
Actual behavior (exhibited in Node.js v4.3.1, v5.8.0):
cc @erights
The text was updated successfully, but these errors were encountered: