blob: 6117d8b6cbc51caca11362aa2ffe2a247f2c995d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
// Forward to the target if the trap is undefined
var p;
var target = function (x, y) {
assertEq(new.target, p);
this.foo = x + y;
}
for (p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
var obj = new p(2, 3);
assertEq(obj.foo, 5);
assertEq(Object.getPrototypeOf(obj), target.prototype);
}
|