Closed
Description
This is more a guess than anything, but apparently accessing Symbol
s 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";
var vm = require("vm");
var symbol = Symbol();
function Document() {
this[symbol] = "foo";
this.prop = "bar";
}
Document.prototype.symbol = function () {
return this[symbol];
};
Document.prototype.property = function () {
return this.prop;
};
var context = new Document();
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, correct
Activity