Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
This is more a guess than anything, but apparently accessing Symbols in a vm context is not forwarded to the original object handle, resulting in different values depending on which side of the sandbox boundary the access happens.
Reduced test case:
"use strict";varvm=require("vm");varsymbol=Symbol();functionDocument(){this[symbol]="foo";this.prop="bar";}Document.prototype.symbol=function(){returnthis[symbol];};Document.prototype.property=function(){returnthis.prop;};varcontext=newDocument();vm.createContext(context);console.log(context.symbol());console.log(vm.runInContext("this.symbol()",context));// should be foo, returns undefined// compare:console.log(context.property());console.log(vm.runInContext("this.property()",context));// should be bar, correctMetadata
Metadata
Assignees
Labels
vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.