summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxySet5.js
blob: d4adcda0feec40faea53d9686f9c31cf4252f88b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Reflect side-effects from the trap
var target = {
    foo: 'bar'
};

var handler = { set: (target, name) => target[name] = 'qux' };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
    p['foo'] = 'baz';
    assertEq(target['foo'], 'qux');

    // reset for second iteration
    target['foo'] = 'bar';
}