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'
Associated with #6158
Empty Proxy object correctly handles this case, but unfortunately it's impossible to access 'built-in' from custom getter (using Reflect)
Second test returns AssertionError: 'undefined' === 'function'