Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
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 });
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 }
34 }
35 }
37 try {
38 test();
39 } catch (e) {}