Closed
Description
- Version: v6.2.2
- Platform: 3.16.0-73-generic feature: Buffer.prototype.indexOf #95~14.04.1-Ubuntu SMP Thu Jun 9 08:00:04 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: vm
Associated with #6158
Empty Proxy object correctly handles this case, but unfortunately it's impossible to access 'built-in' from custom getter (using Reflect)
var assert = require('assert');
var vm = require("vm");
var code = "String.prototype.f = function(){}; ''.f()";
// Test 1
assert.strictEqual(
typeof vm.runInNewContext("String",
new Proxy({},{})),
'function');
// Test 2
assert.strictEqual(
typeof vm.runInNewContext("String",
new Proxy({},{
get: function(target, property, receiver) {
return Reflect.get(target, property);
}
})),
'function');
Second test returns AssertionError: 'undefined' === 'function'