blob: a71a36e80b073acf915aaf038b9cdc753dae18da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Return the trap result
var target = { foo: 'bar' };
var s1 = Symbol("moon"), s2 = Symbol("sun");
target[s1] = "wrong";
var handler = { };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
handler.get = (() => 'baz');
assertEq(p.foo, 'baz');
handler.get = (() => undefined);
assertEq(p.foo, undefined);
handler.get = (() => s2);
assertEq(p[s1], s2);
}
|