comparison: js/src/jit-test/tests/basic/bug657227.js
js/src/jit-test/tests/basic/bug657227.js
- changeset 0
- 6474c204b198
equal
deleted
inserted
replaced
|
1 var obj; |
|
2 var counter = 0; |
|
3 var p = Proxy.create({ |
|
4 has : function(id) { |
|
5 if (id == 'xyz') { |
|
6 ++counter; |
|
7 if (counter == 7) { |
|
8 obj.__proto__ = null; |
|
9 } |
|
10 return true; |
|
11 } |
|
12 return false; |
|
13 }, |
|
14 get : function(id) { |
|
15 if (id == 'xyz') |
|
16 return 10; |
|
17 } |
|
18 }); |
|
19 |
|
20 function test() |
|
21 { |
|
22 Object.prototype.__proto__ = null; |
|
23 obj = { xyz: 1}; |
|
24 var n = 0; |
|
25 for (var i = 0; i != 100; ++i) { |
|
26 var s = obj.xyz; |
|
27 if (s) |
|
28 ++n; |
|
29 if (i == 10) { |
|
30 delete obj.xyz; |
|
31 Object.prototype.__proto__ = p; |
|
32 } |
|
33 |
|
34 } |
|
35 } |
|
36 |
|
37 try { |
|
38 test(); |
|
39 } catch (e) {} |