js/src/jit-test/tests/parallel/closure-eta-expand.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/parallel/closure-eta-expand.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,14 @@
     1.4 +load(libdir + "parallelarray-helpers.js");
     1.5 +
     1.6 +function testClosureCreationAndInvocation() {
     1.7 +  var a = range(1, 65);
     1.8 +  function etaadd1(v) { return (function (x) { return x+1; })(v); };
     1.9 +  // eta-expansion is (or at least can be) treated as call with unknown target
    1.10 +  for (var i in MODES) {
    1.11 +    var m = a.mapPar(etaadd1, MODES[i]);
    1.12 +    assertEq(m[1], 3); // (\x.x+1) 2 == 3
    1.13 +  }
    1.14 +}
    1.15 +
    1.16 +if (getBuildConfiguration().parallelJS)
    1.17 +  testClosureCreationAndInvocation();

mercurial