mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
parent
65afdfbff6
commit
6e4d442cc6
@ -22,7 +22,6 @@ features: [TypedArray]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
|
|
||||||
var ta;
|
var ta;
|
||||||
var array = [];
|
var array = [];
|
||||||
|
|
||||||
@ -35,8 +34,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
array.length = 10000; // big arrays are more likely to cause a crash if they are accessed after they are freed
|
array.length = 10000; // big arrays are more likely to cause a crash if they are accessed after they are freed
|
||||||
array.fill(7, 0);
|
array.fill(7, 0);
|
||||||
ta = new TA(array);
|
ta = new TA(array);
|
||||||
assert.throws(TypeError, function(){
|
assert.throws(TypeError, function(){
|
||||||
ta.copyWithin(0, 100, {valueOf : detachAndReturnIndex}); },
|
ta.copyWithin(0, 100, {valueOf : detachAndReturnIndex});
|
||||||
"should throw TypeError as array is detached");
|
}, "should throw TypeError as array is detached");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,6 @@ features: [TypedArray]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
|
|
||||||
var ta;
|
var ta;
|
||||||
function detachAndReturnIndex(){
|
function detachAndReturnIndex(){
|
||||||
$DETACHBUFFER(ta.buffer);
|
$DETACHBUFFER(ta.buffer);
|
||||||
@ -33,7 +32,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
array.length = 10000; // big arrays are more likely to cause a crash if they are accessed after they are freed
|
array.length = 10000; // big arrays are more likely to cause a crash if they are accessed after they are freed
|
||||||
array.fill(7, 0);
|
array.fill(7, 0);
|
||||||
ta = new TA(array);
|
ta = new TA(array);
|
||||||
assert.throws(TypeError, function(){
|
assert.throws(TypeError, function(){
|
||||||
ta.copyWithin(0, 100, {valueOf : detachAndReturnIndex});
|
ta.copyWithin(0, 100, {valueOf : detachAndReturnIndex});
|
||||||
"should throw TypeError as array is detached");
|
}, "should throw TypeError as array is detached");
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,6 @@ features: [TypedArray]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
|
|
||||||
var ta;
|
var ta;
|
||||||
function detachAndReturnIndex(){
|
function detachAndReturnIndex(){
|
||||||
$DETACHBUFFER(ta.buffer);
|
$DETACHBUFFER(ta.buffer);
|
||||||
@ -33,9 +32,7 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
array.length = 10000; // big arrays are more likely to cause a crash if they are accessed after they are freed
|
array.length = 10000; // big arrays are more likely to cause a crash if they are accessed after they are freed
|
||||||
array.fill(7, 0);
|
array.fill(7, 0);
|
||||||
ta = new TA(array);
|
ta = new TA(array);
|
||||||
assert.throws(TypeError, function(){
|
assert.throws(TypeError, function(){
|
||||||
ta.copyWithin(0, {valueOf : detachAndReturnIndex}, 1000);
|
ta.copyWithin(0, {valueOf : detachAndReturnIndex}, 1000);
|
||||||
"should throw TypeError as array is detached");
|
}, "should throw TypeError as array is detached");
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user