Bug 944975: regression test (r=shu).

Note that this test may only be interest on builds that have been
configured with --enable-more-determinstic; otherwise the toSource
method is not necessarily invoked when the |new| fails.
This commit is contained in:
Felix S. Klock II 2014-02-07 17:56:45 +01:00
parent ff17d0edab
commit b2909d49d2

View File

@ -0,0 +1,17 @@
if (getBuildConfiguration().parallelJS) {
var map_toSource_called = false;
var mapPar_toSource_called = false;
Array.prototype.mapPar.toSource = function() {
mapPar_toSource_called = true;
};
Array.prototype.map.toSource = function() {
map_toSource_called = true;
};
try { new Array.prototype.mapPar; } catch (e) {}
try { new Array.prototype.map; } catch (e) {}
assertEq(map_toSource_called, mapPar_toSource_called);
}