js/src/jit-test/tests/jaeger/recompile/propic.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/jaeger/recompile/propic.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +
     1.5 +/* Recompilation while being processed by property ICs. */
     1.6 +
     1.7 +var ga = 10;
     1.8 +var gb = 10;
     1.9 +
    1.10 +Object.defineProperty(Object.prototype, "a", {
    1.11 +    set: function(a) { eval("ga = true;"); },
    1.12 +    get: function() { eval("gb = true;"); }
    1.13 +  });
    1.14 +
    1.15 +function foo() {
    1.16 +  var x = {};
    1.17 +  x.a = 10;
    1.18 +  assertEq(ga + 1, 2);
    1.19 +}
    1.20 +foo();
    1.21 +
    1.22 +function bar() {
    1.23 +  var x = {};
    1.24 +  var a = x.a;
    1.25 +  assertEq(gb + 1, 2);
    1.26 +}
    1.27 +bar();

mercurial