Update proxy to ES2020 (#4085)

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
kisbg
2020-08-06 11:25:29 +02:00
committed by GitHub
parent c76736eadf
commit 7d479ad91b
5 changed files with 95 additions and 3 deletions
@@ -282,3 +282,30 @@ Object.assign({}, proxy);
assert(result.length === 2);
assert(result[0] === "foo");
assert(result[1] === "bar");
var trapCalls = 0;
var p = new Proxy({}, {
getOwnPropertyDescriptor: function(t, prop) {
Object.defineProperty(t, prop, {
configurable: false,
writable: true,
});
trapCalls++;
return {
configurable: false,
writable: false,
};
},
});
try
{
Object.getOwnPropertyDescriptor(p, "prop");
assert (false)
}
catch (e)
{
assert(e instanceof TypeError)
}