blob: 1825ec259c2c7ea0a0d7f55eace3083d9f1a1bd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// The receiver argument is passed through prototype chains and proxies with no "set" handler.
var hits;
var a = new Proxy({}, {
set(t, id, value, receiver) {
assertEq(id, "prop");
assertEq(value, 3);
assertEq(receiver, b);
hits++;
}
});
var b = Object.create(Object.create(new Proxy(Object.create(new Proxy(a, {})), {})));
hits = 0;
b.prop = 3;
assertEq(hits, 1);
assertEq(b.prop, undefined);
|