propic.js (386B)
1 /* Recompilation while being processed by property ICs. */ 2 3 var ga = 10; 4 var gb = 10; 5 6 Object.defineProperty(Object.prototype, "a", { 7 set: function(a) { eval("ga = true;"); }, 8 get: function() { eval("gb = true;"); } 9 }); 10 11 function foo() { 12 var x = {}; 13 x.a = 10; 14 assertEq(ga + 1, 2); 15 } 16 foo(); 17 18 function bar() { 19 var x = {}; 20 var a = x.a; 21 assertEq(gb + 1, 2); 22 } 23 bar();