summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/recompile/propic.js
blob: f394c4c4673ba88d60443c24af71c922f0417261 (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

/* Recompilation while being processed by property ICs. */

var ga = 10;
var gb = 10;

Object.defineProperty(Object.prototype, "a", {
    set: function(a) { eval("ga = true;"); },
    get: function() { eval("gb = true;"); }
  });

function foo() {
  var x = {};
  x.a = 10;
  assertEq(ga + 1, 2);
}
foo();

function bar() {
  var x = {};
  var a = x.a;
  assertEq(gb + 1, 2);
}
bar();