-
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
Proxy passed as vm context hides built-in properties. #6158
Labels
vm
Issues and PRs related to the vm subsystem.
Comments
I think the issue is because |
This should be fixed upstream in V8 5.2: https://codereview.chromium.org/1929853002. I will request a merge back to V8 5.0 in upstream. |
3 tasks
targos
added a commit
to targos/node
that referenced
this issue
May 26, 2016
A Proxy context should not hide built-in global objects. Ref: nodejs#6158 PR-URL: nodejs#6967 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Fishrock123
pushed a commit
to Fishrock123/node
that referenced
this issue
May 30, 2016
Pick up the latest set of patch level updates from the V8 5.0 branch. v8/v8@5.0.71.47...5.0.71.52 Fixes: nodejs#6158 PR-URL: nodejs#6928 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fishrock123
pushed a commit
to Fishrock123/node
that referenced
this issue
May 30, 2016
A Proxy context should not hide built-in global objects. Ref: nodejs#6158 PR-URL: nodejs#6967 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
rvagg
pushed a commit
that referenced
this issue
Jun 2, 2016
Pick up the latest set of patch level updates from the V8 5.0 branch. v8/v8@5.0.71.47...5.0.71.52 Fixes: #6158 PR-URL: #6928 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proxy object is not correctly contextified by vm.createContext routine.
I've tried to create vm with traps on global context, so I made one based on Proxy object.
Unfortunately, code executed inside vm doesn't have any access to built-ins.
Passing required built-ins this way:
ctx = new Proxy({String:String}, {})
vm.runInNewContext("String", ctx)
seems to be (a bit dirty) workaround, but it doesn't resolve a problem at all...
vm.runInNewContext("String.prototype.f = function(){}; ''.f()", ctx)
... because passed String differs from used built-in by string literal, so this code raises an exception (''.f is undefined)
Tested on builds from branches node-vee-eight-4.9/5.0
Proxies doesn't work with older V8s and VMs, because of "not an object" bug.
The text was updated successfully, but these errors were encountered: