summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Proxy/proxy-with-revoked-arguments.js
blob: a60dddbea6a15a84b7b643cdaf5f9d2d722e87f5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var BUGNUMBER = 1151149;
var summary = "Proxy constructor should not throw if either the target or handler is a revoked proxy.";

print(BUGNUMBER + ": " + summary);

var p = new Proxy({}, {});

new Proxy(p, {});
new Proxy({}, p);

var r = Proxy.revocable({}, {});
p = r.proxy;

new Proxy(p, {});
new Proxy({}, p);

r.revoke();

new Proxy(p, {});
new Proxy({}, p);


var r2 = Proxy.revocable({}, {});
r = Proxy.revocable(r2.proxy, {});
p = r.proxy;

new Proxy(p, {});
new Proxy({}, p);

r2.revoke();

new Proxy(p, {});
new Proxy({}, p);

r.revoke();

new Proxy(p, {});
new Proxy({}, p);


var g = newGlobal();
p = g.eval(`var r = Proxy.revocable({}, {}); r.proxy;`);

new Proxy(p, {});
new Proxy({}, p);

g.eval(`r.revoke();`);

new Proxy(p, {});
new Proxy({}, p);

if (typeof reportCompare === "function")
  reportCompare(true, true);