js/src/jit-test/tests/jaeger/recompile/nativemulti.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/nativemulti.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +
     1.5 +/* Recompilation that requires patching the same native stub multiple times. */
     1.6 +
     1.7 +var first = 0;
     1.8 +var second = 0;
     1.9 +
    1.10 +function foreachweird(a, f, vfirst, vsecond)
    1.11 +{
    1.12 +  a.forEach(f);
    1.13 +  assertEq(first, vfirst);
    1.14 +  assertEq(second, vsecond);
    1.15 +}
    1.16 +
    1.17 +function weird() {
    1.18 +  eval("first = 'one';");
    1.19 +  eval("second = 'two';");
    1.20 +}
    1.21 +
    1.22 +foreachweird([0], function() {}, 0, 0);
    1.23 +foreachweird([0], function() {}, 0, 0);
    1.24 +foreachweird([0], weird, 'one', 'two');

mercurial