Add proxy support for HasBinding operation for Object Environment records (#3731)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-05-13 14:27:31 +02:00
committed by GitHub
parent 4dc2cb3328
commit 9ad9d574fe
4 changed files with 116 additions and 69 deletions
+21
View File
@@ -104,3 +104,24 @@ with (a) {
assert(foo === 1);
assert(typeof bar === "undefined");
}
let track = [];
let proxy = new Proxy({ a : 4, [Symbol.unscopables] : [] }, {
has (t, p) {
track.push(p);
return Reflect.has(...arguments);
},
get (t, p, r) {
track.push(p);
return Reflect.get(...arguments);
}
});
with (proxy){
a;
}
assert(track.length == 3);
assert(track[0] === 'a');
assert(track[1] === Symbol.unscopables);
assert(track[2] === 'a');