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
+18
View File
@@ -162,3 +162,21 @@ try {
} catch (e) {
assert(e instanceof TypeError);
}
var trapCalls = 0;
var p = new Proxy({prop: 1}, {
deleteProperty: function(t, prop) {
Object.preventExtensions(t);
trapCalls++;
return true;
},
});
try {
Reflect.deleteProperty (p, "prop");
assert (false);
} catch (e) {
assert (e instanceof TypeError);
}
assert (trapCalls == 1);