js/src/jit-test/tests/parallel/surfaces-2.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 // ParallelArray methods throw when passed a this-value that isn't a ParallelArray.
     3 load(libdir + "asserts.js");
     5 function testcase(obj, fn) {
     6     assertEq(typeof fn, "function");
     7     var args = Array.slice(arguments, 2);
     8     assertThrowsInstanceOf(function () { fn.apply(obj, args); }, TypeError);
     9 }
    11 function test(obj) {
    12     function f() {}
    13     testcase(obj, ParallelArray.prototype.map, f);
    14     testcase(obj, ParallelArray.prototype.reduce, f);
    15     testcase(obj, ParallelArray.prototype.scan, f);
    16     testcase(obj, ParallelArray.prototype.scatter, [0]);
    17     testcase(obj, ParallelArray.prototype.filter, [0]);
    18     testcase(obj, ParallelArray.prototype.flatten);
    19     testcase(obj, ParallelArray.prototype.partition, 2);
    20     testcase(obj, ParallelArray.prototype.get, [1]);
    21 }
    23 // FIXME(bug 844887) check type of this
    24 // if (getBuildConfiguration().parallelJS) {
    25 // test(ParallelArray.prototype);
    26 // test(Object.create(new ParallelArray));
    27 // test({});
    28 // test(null);
    29 // test(undefined);
    30 // }

mercurial