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
@@ -174,3 +174,27 @@ try {
} catch (e) {
assert(e instanceof TypeError);
}
var trapCalls = 0;
var p = new Proxy({}, {
defineProperty: function(t, prop, desc) {
Object.defineProperty(t, prop, {
configurable: false,
writable: true,
});
trapCalls++;
return true;
},
});
try {
Reflect.defineProperty (p, "prop", {
writable: false,
});
assert (false);
} catch (e) {
assert (e instanceof TypeError);
}
assert (trapCalls == 1)