js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,13 @@
     1.4 +// Test that the tracer is not confused by a.m() when a is the same shape each
     1.5 +// time through the loop but a.m is a scripted getter that returns different
     1.6 +// functions.
     1.7 +
     1.8 +function f() { return 'f'; }
     1.9 +function g() { return 'g'; }
    1.10 +var arr = [f, f, f, f, f, f, f, f, g];
    1.11 +var a = {get m() { return arr[i]; }};
    1.12 +
    1.13 +var s = '';
    1.14 +for (var i = 0; i < 9; i++)
    1.15 +    s += a.m();
    1.16 +assertEq(s, 'ffffffffg');

mercurial