[FIX] web: utils: backport of swap() for enterprise compatibility

This commit is contained in:
Aaron Bohy
2016-01-14 11:22:25 +01:00
parent 5c50ba322f
commit 029c0d5567
@@ -411,6 +411,13 @@ var DropMisordered = Class.extend({
},
});
function swap(array, elem1, elem2) {
var i1 = array.indexOf(elem1);
var i2 = array.indexOf(elem2);
array[i2] = elem1;
array[i1] = elem2;
}
return {
divmod: divmod,
@@ -437,6 +444,7 @@ return {
assert: assert,
xor: xor,
DropMisordered: DropMisordered,
swap: swap,
};
});