Bug 1268574 - Check the outparam JSFunction* value after GetGetterPure. r=lth

This commit is contained in:
Tooru Fujisawa 2016-04-29 02:46:22 +09:00
parent 6f80eee720
commit aa8be126c7
4 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,5 @@
delete ArrayBuffer[Symbol.species];
var a = new Uint8Array(new Uint8Array([1, 2]));
assertEq(a.length, 2);
assertEq(a[0], 1);
assertEq(a[1], 2);

View File

@ -0,0 +1,5 @@
delete Array[Symbol.species];
var a = [1, 2, 3].slice(1);
assertEq(a.length, 2);
assertEq(a[0], 2);
assertEq(a[1], 3);

View File

@ -923,6 +923,9 @@ IsArraySpecies(JSContext* cx, HandleObject origArray)
if (!GetGetterPure(cx, ctorObj, speciesId, &getter))
return false;
if (!getter)
return false;
return IsSelfHostedFunctionWithName(getter, cx->names().ArraySpecies);
}

View File

@ -787,6 +787,9 @@ IsArrayBufferSpecies(JSContext* cx, HandleObject origBuffer)
if (!GetGetterPure(cx, ctorObj, speciesId, &getter))
return false;
if (!getter)
return false;
return IsSelfHostedFunctionWithName(getter, cx->names().ArrayBufferSpecies);
}