mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 977647 -- check for empty arrays in mapPar r=shu
This commit is contained in:
parent
8c0088f49e
commit
4cd3ac885b
@ -1438,6 +1438,8 @@ function MapTypedParImplDepth1(inArray, inArrayType, outArrayType, func) {
|
||||
const mode = undefined;
|
||||
|
||||
const outArray = new outArrayType(length);
|
||||
if (length === 0)
|
||||
return outArray;
|
||||
|
||||
const outGrainTypeIsTransparent = ObjectIsTransparentTypedObject(outArray);
|
||||
|
||||
|
12
js/src/jit-test/tests/parallel/bug977647.js
Normal file
12
js/src/jit-test/tests/parallel/bug977647.js
Normal file
@ -0,0 +1,12 @@
|
||||
// Check for mapPar() applied to an empty array.
|
||||
// Public domain.
|
||||
|
||||
if (!this.hasOwnProperty("TypedObject"))
|
||||
quit();
|
||||
|
||||
var { ArrayType, StructType, uint32 } = TypedObject;
|
||||
var Point = new StructType({x: uint32, y: uint32});
|
||||
var Points = Point.array();
|
||||
var points = new Points();
|
||||
points.mapPar(function() {});
|
||||
|
Loading…
Reference in New Issue
Block a user