blob: 21768505006f231acda009f278e2b1941f1ec356 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Forward to the target if the trap is not defined
var proto = Object.create(null, {
a: {
enumerable: true,
configurable: true
},
b: {
enumerable: false,
configurable: true
}
});
var target = Object.create(proto, {
c: {
enumerable: true,
configurable: true
},
d: {
enumerable: false,
configurable: true
}
});
for (let p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
var names = Object.keys(p);
assertEq(names.length, 1);
assertEq(names[0], 'c');
}
|