Bug 977900: Add collide method back in Array.scatterPar; r=shu

This commit is contained in:
Benjamin Bouvier 2014-03-04 09:58:06 +01:00
parent 9be1d4b017
commit 20c3ec5a1a
2 changed files with 12 additions and 0 deletions

View File

@ -890,6 +890,13 @@ function ArrayScatterPar(targets, defaultValue, conflictFunc, length, mode) {
return buffer;
}
function collide(elem1, elem2) {
if (conflictFunc === undefined)
ThrowError(JSMSG_PAR_ARRAY_SCATTER_CONFLICT);
return conflictFunc(elem1, elem2);
}
function checkTarget(i, t) {
if (TO_INT32(t) !== t)
ThrowError(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, i);

View File

@ -0,0 +1,5 @@
if (!getBuildConfiguration().parallelJS)
quit();
function chooseMax(a, b) { return a>b?a:b;};
var a = [1,2].scatterPar([0,0], -1, chooseMax);