mirror of https://github.com/tc39/test262.git
built-ins/Array/*: make all indentation consistent (depth & character) (#1415)
This commit is contained in:
parent
0bf08dff3d
commit
afa24856b4
|
@ -11,7 +11,11 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String)
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = [];
|
var x = [];
|
||||||
var object = {valueOf: function() {return 1}};
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object] = 0;
|
x[object] = 0;
|
||||||
if (x["[object Object]"] !== 0) {
|
if (x["[object Object]"] !== 0) {
|
||||||
$ERROR('#1: x = []; var object = {valueOf: function() {return 1}}; x[object] = 0; x["[object Object]"] === 0. Actual: ' + (x["[object Object]"]));
|
$ERROR('#1: x = []; var object = {valueOf: function() {return 1}}; x[object] = 0; x["[object Object]"] === 0. Actual: ' + (x["[object Object]"]));
|
||||||
|
@ -19,7 +23,14 @@ if (x["[object Object]"] !== 0) {
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
x = [];
|
x = [];
|
||||||
var object = {valueOf: function() {return 1}, toString: function() {return 0}};
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 1
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object] = 0;
|
x[object] = 0;
|
||||||
if (x[0] !== 0) {
|
if (x[0] !== 0) {
|
||||||
$ERROR('#2: x = []; var object = {valueOf: function() {return 1}, toString: function() {return 0}}; x[object] = 0; x[0] === 0. Actual: ' + (x[0]));
|
$ERROR('#2: x = []; var object = {valueOf: function() {return 1}, toString: function() {return 0}}; x[object] = 0; x[0] === 0. Actual: ' + (x[0]));
|
||||||
|
@ -27,7 +38,14 @@ if (x[0] !== 0) {
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
x = [];
|
x = [];
|
||||||
var object = {valueOf: function() {return 1}, toString: function() {return {}}};
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 1
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object] = 0;
|
x[object] = 0;
|
||||||
if (x[1] !== 0) {
|
if (x[1] !== 0) {
|
||||||
$ERROR('#3: x = []; var object = {valueOf: function() {return 1}, toString: function() {return {}}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
|
$ERROR('#3: x = []; var object = {valueOf: function() {return 1}, toString: function() {return {}}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
|
||||||
|
@ -36,7 +54,14 @@ if (x[1] !== 0) {
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
try {
|
try {
|
||||||
x = [];
|
x = [];
|
||||||
var object = {valueOf: function() {throw "error"}, toString: function() {return 1}};
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
throw "error"
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object] = 0;
|
x[object] = 0;
|
||||||
if (x[1] !== 0) {
|
if (x[1] !== 0) {
|
||||||
$ERROR('#4.1: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (x[1]));
|
$ERROR('#4.1: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (x[1]));
|
||||||
|
@ -52,7 +77,11 @@ catch (e) {
|
||||||
|
|
||||||
//CHECK#5
|
//CHECK#5
|
||||||
x = [];
|
x = [];
|
||||||
var object = {toString: function() {return 1}};
|
var object = {
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object] = 0;
|
x[object] = 0;
|
||||||
if (x[1] !== 0) {
|
if (x[1] !== 0) {
|
||||||
$ERROR('#5: x = []; var object = {toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
|
$ERROR('#5: x = []; var object = {toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
|
||||||
|
@ -60,7 +89,14 @@ if (x[1] !== 0) {
|
||||||
|
|
||||||
//CHECK#6
|
//CHECK#6
|
||||||
x = [];
|
x = [];
|
||||||
var object = {valueOf: function() {return {}}, toString: function() {return 1}}
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
x[object] = 0;
|
x[object] = 0;
|
||||||
if (x[1] !== 0) {
|
if (x[1] !== 0) {
|
||||||
$ERROR('#6: x = []; var object = {valueOf: function() {return {}}, toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
|
$ERROR('#6: x = []; var object = {valueOf: function() {return {}}, toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1]));
|
||||||
|
@ -69,7 +105,14 @@ if (x[1] !== 0) {
|
||||||
//CHECK#7
|
//CHECK#7
|
||||||
try {
|
try {
|
||||||
x = [];
|
x = [];
|
||||||
var object = {valueOf: function() {return 1}, toString: function() {throw "error"}};
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 1
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
throw "error"
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object];
|
x[object];
|
||||||
$ERROR('#7.1: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (x[object]));
|
$ERROR('#7.1: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (x[object]));
|
||||||
}
|
}
|
||||||
|
@ -82,7 +125,14 @@ catch (e) {
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
try {
|
try {
|
||||||
x = [];
|
x = [];
|
||||||
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
|
var object = {
|
||||||
|
valueOf: function() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
};
|
||||||
x[object];
|
x[object];
|
||||||
$ERROR('#8.1: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (x[object]));
|
$ERROR('#8.1: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (x[object]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,9 @@ function MyCollection() {
|
||||||
this.args = arguments;
|
this.args = arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = Array.from.call(MyCollection, {length: 42});
|
result = Array.from.call(MyCollection, {
|
||||||
|
length: 42
|
||||||
|
});
|
||||||
|
|
||||||
assert.sameValue(result.args.length, 1);
|
assert.sameValue(result.args.length, 1);
|
||||||
assert.sameValue(result.args[0], 42);
|
assert.sameValue(result.args[0], 42);
|
||||||
|
|
|
@ -20,6 +20,7 @@ var obj = {
|
||||||
6: 128
|
6: 128
|
||||||
};
|
};
|
||||||
var array = [2, 4, 8, 16, 32, 64, 128];
|
var array = [2, 4, 8, 16, 32, 64, 128];
|
||||||
|
|
||||||
function mapFn(value, index) {
|
function mapFn(value, index) {
|
||||||
arrayIndex++;
|
arrayIndex++;
|
||||||
assert.sameValue(value, obj[arrayIndex], "Value mismatch in mapFn at index " + index + ".");
|
assert.sameValue(value, obj[arrayIndex], "Value mismatch in mapFn at index " + index + ".");
|
||||||
|
|
|
@ -13,6 +13,7 @@ var originalArray = [ 0, 1, -2, 4, -8, 16 ];
|
||||||
var array = [0, 1, -2, 4, -8, 16];
|
var array = [0, 1, -2, 4, -8, 16];
|
||||||
var a = [];
|
var a = [];
|
||||||
var arrayIndex = -1;
|
var arrayIndex = -1;
|
||||||
|
|
||||||
function mapFn(value, index) {
|
function mapFn(value, index) {
|
||||||
this.arrayIndex++;
|
this.arrayIndex++;
|
||||||
assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + ".");
|
assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + ".");
|
||||||
|
|
|
@ -9,6 +9,7 @@ es6id: 22.1.2.1
|
||||||
|
|
||||||
var array = [127, 4, 8, 16, 32, 64, 128];
|
var array = [127, 4, 8, 16, 32, 64, 128];
|
||||||
var arrayIndex = -1;
|
var arrayIndex = -1;
|
||||||
|
|
||||||
function mapFn(value, index) {
|
function mapFn(value, index) {
|
||||||
arrayIndex++;
|
arrayIndex++;
|
||||||
if (index + 1 < array.length) {
|
if (index + 1 < array.length) {
|
||||||
|
|
|
@ -27,7 +27,9 @@ var items = {};
|
||||||
items[Symbol.iterator] = function() {
|
items[Symbol.iterator] = function() {
|
||||||
return {
|
return {
|
||||||
next: function() {
|
next: function() {
|
||||||
return { done: true };
|
return {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,8 +26,14 @@ features: [Symbol.iterator]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var args = [];
|
var args = [];
|
||||||
var firstResult = { done: false, value: {} };
|
var firstResult = {
|
||||||
var secondResult = { done: false, value: {} };
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
|
var secondResult = {
|
||||||
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
var mapFn = function(value, idx) {
|
var mapFn = function(value, idx) {
|
||||||
args.push(arguments);
|
args.push(arguments);
|
||||||
};
|
};
|
||||||
|
@ -40,7 +46,9 @@ items[Symbol.iterator] = function() {
|
||||||
next: function() {
|
next: function() {
|
||||||
var result = nextResult;
|
var result = nextResult;
|
||||||
nextResult = nextNextResult;
|
nextResult = nextNextResult;
|
||||||
nextNextResult = { done: true };
|
nextNextResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,14 @@ features: [Symbol.iterator]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var thisVals = [];
|
var thisVals = [];
|
||||||
var nextResult = { done: false, value: {} };
|
var nextResult = {
|
||||||
var nextNextResult = { done: false, value: {} };
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
|
var nextNextResult = {
|
||||||
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
var firstReturnVal = {};
|
var firstReturnVal = {};
|
||||||
var secondReturnVal = {};
|
var secondReturnVal = {};
|
||||||
var mapFn = function(value, idx) {
|
var mapFn = function(value, idx) {
|
||||||
|
@ -45,7 +51,9 @@ items[Symbol.iterator] = function() {
|
||||||
next: function() {
|
next: function() {
|
||||||
var result = nextResult;
|
var result = nextResult;
|
||||||
nextResult = nextNextResult;
|
nextResult = nextNextResult;
|
||||||
nextNextResult = { done: true };
|
nextNextResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,14 @@ features: [Symbol.iterator]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var thisVals = [];
|
var thisVals = [];
|
||||||
var nextResult = { done: false, value: {} };
|
var nextResult = {
|
||||||
var nextNextResult = { done: false, value: {} };
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
|
var nextNextResult = {
|
||||||
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
var mapFn = function() {
|
var mapFn = function() {
|
||||||
thisVals.push(this);
|
thisVals.push(this);
|
||||||
};
|
};
|
||||||
|
@ -36,7 +42,9 @@ items[Symbol.iterator] = function() {
|
||||||
next: function() {
|
next: function() {
|
||||||
var result = nextResult;
|
var result = nextResult;
|
||||||
nextResult = nextNextResult;
|
nextResult = nextNextResult;
|
||||||
nextNextResult = { done: true };
|
nextNextResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,20 +24,30 @@ flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var thisVals = [];
|
var thisVals = [];
|
||||||
var nextResult = { done: false, value: {} };
|
var nextResult = {
|
||||||
var nextNextResult = { done: false, value: {} };
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
|
var nextNextResult = {
|
||||||
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
var mapFn = function() {
|
var mapFn = function() {
|
||||||
thisVals.push(this);
|
thisVals.push(this);
|
||||||
};
|
};
|
||||||
var items = {};
|
var items = {};
|
||||||
var global = function() { return this; }();
|
var global = function() {
|
||||||
|
return this;
|
||||||
|
}();
|
||||||
|
|
||||||
items[Symbol.iterator] = function() {
|
items[Symbol.iterator] = function() {
|
||||||
return {
|
return {
|
||||||
next: function() {
|
next: function() {
|
||||||
var result = nextResult;
|
var result = nextResult;
|
||||||
nextResult = nextNextResult;
|
nextResult = nextNextResult;
|
||||||
nextNextResult = { done: true };
|
nextNextResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,14 @@ flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var thisVals = [];
|
var thisVals = [];
|
||||||
var nextResult = { done: false, value: {} };
|
var nextResult = {
|
||||||
var nextNextResult = { done: false, value: {} };
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
|
var nextNextResult = {
|
||||||
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
var mapFn = function() {
|
var mapFn = function() {
|
||||||
thisVals.push(this);
|
thisVals.push(this);
|
||||||
};
|
};
|
||||||
|
@ -36,7 +42,9 @@ items[Symbol.iterator] = function() {
|
||||||
next: function() {
|
next: function() {
|
||||||
var result = nextResult;
|
var result = nextResult;
|
||||||
nextResult = nextNextResult;
|
nextResult = nextNextResult;
|
||||||
nextNextResult = { done: true };
|
nextNextResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,11 +18,15 @@ features: [Symbol.iterator]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var C = function() {
|
var C = function() {
|
||||||
Object.defineProperty(this, '0', { configurable: false });
|
Object.defineProperty(this, '0', {
|
||||||
|
configurable: false
|
||||||
|
});
|
||||||
};
|
};
|
||||||
var closeCount = 0;
|
var closeCount = 0;
|
||||||
var items = {};
|
var items = {};
|
||||||
var nextResult = { done: false };
|
var nextResult = {
|
||||||
|
done: false
|
||||||
|
};
|
||||||
|
|
||||||
items[Symbol.iterator] = function() {
|
items[Symbol.iterator] = function() {
|
||||||
return {
|
return {
|
||||||
|
@ -32,7 +36,9 @@ items[Symbol.iterator] = function() {
|
||||||
next: function() {
|
next: function() {
|
||||||
var result = nextResult;
|
var result = nextResult;
|
||||||
|
|
||||||
nextResult = { done: true };
|
nextResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,18 @@ features: [Symbol.iterator]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var items = {};
|
var items = {};
|
||||||
var firstIterResult = { done: false, value: {} };
|
var firstIterResult = {
|
||||||
var secondIterResult = { done: false, value: {} };
|
done: false,
|
||||||
var thirdIterResult = { done: true, value: {} };
|
value: {}
|
||||||
|
};
|
||||||
|
var secondIterResult = {
|
||||||
|
done: false,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
|
var thirdIterResult = {
|
||||||
|
done: true,
|
||||||
|
value: {}
|
||||||
|
};
|
||||||
var nextIterResult = firstIterResult;
|
var nextIterResult = firstIterResult;
|
||||||
var nextNextIterResult = secondIterResult;
|
var nextNextIterResult = secondIterResult;
|
||||||
var result;
|
var result;
|
||||||
|
|
|
@ -25,7 +25,11 @@ Object.defineProperty(C.prototype, 'length', {
|
||||||
});
|
});
|
||||||
items[Symbol.iterator] = function() {
|
items[Symbol.iterator] = function() {
|
||||||
return {
|
return {
|
||||||
next: function() { return { done: true }; }
|
next: function() {
|
||||||
|
return {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,19 @@ items[Symbol.iterator] = function() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nextIterResult = lastIterResult = { done: true };
|
nextIterResult = lastIterResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
result = Array.from(items);
|
result = Array.from(items);
|
||||||
|
|
||||||
assert.sameValue(result.length, 0);
|
assert.sameValue(result.length, 0);
|
||||||
|
|
||||||
nextIterResult = { done: false };
|
nextIterResult = {
|
||||||
lastIterResult = { done: true };
|
done: false
|
||||||
|
};
|
||||||
|
lastIterResult = {
|
||||||
|
done: true
|
||||||
|
};
|
||||||
result = Array.from(items);
|
result = Array.from(items);
|
||||||
|
|
||||||
assert.sameValue(result.length, 1);
|
assert.sameValue(result.length, 1);
|
||||||
|
|
|
@ -8,8 +8,11 @@ es6id: 22.1.2.1
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var array = [2, 4, 8, 16, 32, 64, 128];
|
var array = [2, 4, 8, 16, 32, 64, 128];
|
||||||
|
|
||||||
function mapFn(value, index, obj) {
|
function mapFn(value, index, obj) {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.throws(Test262Error, function(){Array.from(array, mapFn);});
|
assert.throws(Test262Error, function() {
|
||||||
|
Array.from(array, mapFn);
|
||||||
|
});
|
||||||
|
|
|
@ -9,6 +9,7 @@ es6id: 22.1.2.1
|
||||||
|
|
||||||
var array = [Number.MAX_VALUE, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY];
|
var array = [Number.MAX_VALUE, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY];
|
||||||
var arrayIndex = -1;
|
var arrayIndex = -1;
|
||||||
|
|
||||||
function mapFn(value, index) {
|
function mapFn(value, index) {
|
||||||
this.arrayIndex++;
|
this.arrayIndex++;
|
||||||
assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + ".");
|
assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + ".");
|
||||||
|
|
|
@ -27,4 +27,6 @@ var obj = {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
assert.throws(Test262Error, function(){Array.from(obj);});
|
assert.throws(Test262Error, function() {
|
||||||
|
Array.from(obj);
|
||||||
|
});
|
||||||
|
|
|
@ -9,4 +9,8 @@ description: >
|
||||||
indexed properties
|
indexed properties
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(Array.isArray({ 0: 12, 1: 9, length: 2 }), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })');
|
assert.sameValue(Array.isArray({
|
||||||
|
0: 12,
|
||||||
|
1: 9,
|
||||||
|
length: 2
|
||||||
|
}), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })');
|
||||||
|
|
|
@ -10,21 +10,39 @@ description: Uint32 use ToNumber and ToPrimitve
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = [];
|
var x = [];
|
||||||
x.length = {valueOf: function() {return 2}};
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
};
|
||||||
if (x.length !== 2) {
|
if (x.length !== 2) {
|
||||||
$ERROR('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length));
|
$ERROR('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {valueOf: function() {return 2}, toString: function() {return 1}};
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 2
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
};
|
||||||
if (x.length !== 2) {
|
if (x.length !== 2) {
|
||||||
$ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length));
|
$ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {valueOf: function() {return 2}, toString: function() {return {}}};
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 2
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
};
|
||||||
if (x.length !== 2) {
|
if (x.length !== 2) {
|
||||||
$ERROR('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length));
|
$ERROR('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
@ -32,7 +50,14 @@ if (x.length !== 2) {
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
try {
|
try {
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}};
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
return 2
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
throw "error"
|
||||||
|
}
|
||||||
|
};
|
||||||
if (x.length !== 2) {
|
if (x.length !== 2) {
|
||||||
$ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length));
|
$ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
@ -47,14 +72,25 @@ catch (e) {
|
||||||
|
|
||||||
//CHECK#5
|
//CHECK#5
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {toString: function() {return 1}};
|
x.length = {
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
};
|
||||||
if (x.length !== 1) {
|
if (x.length !== 1) {
|
||||||
$ERROR('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
|
$ERROR('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#6
|
//CHECK#6
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {valueOf: function() {return {}}, toString: function() {return 1}}
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
if (x.length !== 1) {
|
if (x.length !== 1) {
|
||||||
$ERROR('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
|
$ERROR('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
@ -62,7 +98,14 @@ if (x.length !== 1) {
|
||||||
//CHECK#7
|
//CHECK#7
|
||||||
try {
|
try {
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}};
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
throw "error"
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
};
|
||||||
x.length;
|
x.length;
|
||||||
$ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length));
|
$ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
@ -75,7 +118,14 @@ catch (e) {
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
try {
|
try {
|
||||||
x = [];
|
x = [];
|
||||||
x.length = {valueOf: function() {return {}}, toString: function() {return {}}};
|
x.length = {
|
||||||
|
valueOf: function() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
toString: function() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
};
|
||||||
x.length;
|
x.length;
|
||||||
$ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length));
|
$ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,11 @@ features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
function MyError() {}
|
function MyError() {}
|
||||||
var obj = {
|
var obj = {
|
||||||
"length": { toString: function() {
|
"length": {
|
||||||
|
toString: function() {
|
||||||
throw new MyError();
|
throw new MyError();
|
||||||
}, valueOf: null
|
},
|
||||||
|
valueOf: null
|
||||||
},
|
},
|
||||||
"1": "A",
|
"1": "A",
|
||||||
"3": "B",
|
"3": "B",
|
||||||
|
|
|
@ -15,7 +15,17 @@ var obj = {
|
||||||
"5": "C"
|
"5": "C"
|
||||||
};
|
};
|
||||||
obj[Symbol.isConcatSpreadable] = true;
|
obj[Symbol.isConcatSpreadable] = true;
|
||||||
obj.length = {toString: function() { return "SIX"; }, valueOf: null };
|
obj.length = {
|
||||||
|
toString: function() {
|
||||||
|
return "SIX";
|
||||||
|
},
|
||||||
|
valueOf: null
|
||||||
|
};
|
||||||
assert(compareArray([].concat(obj), []));
|
assert(compareArray([].concat(obj), []));
|
||||||
obj.length = {toString: null, valueOf: function() { return "SIX"; } };
|
obj.length = {
|
||||||
|
toString: null,
|
||||||
|
valueOf: function() {
|
||||||
|
return "SIX";
|
||||||
|
}
|
||||||
|
};
|
||||||
assert(compareArray([].concat(obj), []));
|
assert(compareArray([].concat(obj), []));
|
||||||
|
|
|
@ -16,7 +16,12 @@ var obj = {
|
||||||
"5": "C"
|
"5": "C"
|
||||||
};
|
};
|
||||||
obj[Symbol.isConcatSpreadable] = true;
|
obj[Symbol.isConcatSpreadable] = true;
|
||||||
var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" };
|
var obj2 = {
|
||||||
|
length: 3,
|
||||||
|
"0": "0",
|
||||||
|
"1": "1",
|
||||||
|
"2": "2"
|
||||||
|
};
|
||||||
var arr = ["X", "Y", "Z"];
|
var arr = ["X", "Y", "Z"];
|
||||||
|
|
||||||
var expected = [
|
var expected = [
|
||||||
|
|
|
@ -9,13 +9,21 @@ description: Array.prototype.concat array like to length throws
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
var obj = {
|
var obj = {
|
||||||
"length": {valueOf: null, toString: null},
|
"length": {
|
||||||
|
valueOf: null,
|
||||||
|
toString: null
|
||||||
|
},
|
||||||
"1": "A",
|
"1": "A",
|
||||||
"3": "B",
|
"3": "B",
|
||||||
"5": "C"
|
"5": "C"
|
||||||
};
|
};
|
||||||
obj[Symbol.isConcatSpreadable] = true;
|
obj[Symbol.isConcatSpreadable] = true;
|
||||||
var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" };
|
var obj2 = {
|
||||||
|
length: 3,
|
||||||
|
"0": "0",
|
||||||
|
"1": "1",
|
||||||
|
"2": "2"
|
||||||
|
};
|
||||||
var arr = ["X", "Y", "Z"];
|
var arr = ["X", "Y", "Z"];
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Array.prototype.concat.call(obj, obj2, arr);
|
Array.prototype.concat.call(obj, obj2, arr);
|
||||||
|
|
|
@ -17,7 +17,12 @@ var obj = {
|
||||||
"5": "C"
|
"5": "C"
|
||||||
};
|
};
|
||||||
obj[Symbol.isConcatSpreadable] = true;
|
obj[Symbol.isConcatSpreadable] = true;
|
||||||
var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" };
|
var obj2 = {
|
||||||
|
length: 3,
|
||||||
|
"0": "0",
|
||||||
|
"1": "1",
|
||||||
|
"2": "2"
|
||||||
|
};
|
||||||
var arr = ["X", "Y", "Z"];
|
var arr = ["X", "Y", "Z"];
|
||||||
|
|
||||||
var expected = [
|
var expected = [
|
||||||
|
|
|
@ -10,7 +10,9 @@ description: Array.prototype.concat holey sloppy arguments
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
var args = (function(a) { return arguments; })(1,2,3);
|
var args = (function(a) {
|
||||||
|
return arguments;
|
||||||
|
})(1, 2, 3);
|
||||||
delete args[1];
|
delete args[1];
|
||||||
args[Symbol.isConcatSpreadable] = true;
|
args[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([1, void 0, 3, 1, void 0, 3], [].concat(args, args)));
|
assert(compareArray([1, void 0, 3, 1, void 0, 3], [].concat(args, args)));
|
||||||
|
|
|
@ -31,7 +31,9 @@ function concatTypedArray(type, elems, modulo) {
|
||||||
var expected = new Array(4000);
|
var expected = new Array(4000);
|
||||||
expected[0] = defValue;
|
expected[0] = defValue;
|
||||||
|
|
||||||
Object.defineProperty(ta, "length", { value: 4000 });
|
Object.defineProperty(ta, "length", {
|
||||||
|
value: 4000
|
||||||
|
});
|
||||||
ta[Symbol.isConcatSpreadable] = true;
|
ta[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([].concat(ta), expected));
|
assert(compareArray([].concat(ta), expected));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,9 @@ function MyError() {}
|
||||||
var obj = {};
|
var obj = {};
|
||||||
obj[Symbol.isConcatSpreadable] = true;
|
obj[Symbol.isConcatSpreadable] = true;
|
||||||
Object.defineProperty(obj, "length", {
|
Object.defineProperty(obj, "length", {
|
||||||
get: function() { throw new MyError(); }
|
get: function() {
|
||||||
|
throw new MyError();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.throws(MyError, function() {
|
assert.throws(MyError, function() {
|
||||||
|
|
|
@ -10,9 +10,13 @@ description: Array.prototype.concat sloppy arguments throws
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
function MyError() {}
|
function MyError() {}
|
||||||
var args = (function(a) { return arguments; })(1,2,3);
|
var args = (function(a) {
|
||||||
|
return arguments;
|
||||||
|
})(1, 2, 3);
|
||||||
Object.defineProperty(args, 0, {
|
Object.defineProperty(args, 0, {
|
||||||
get: function() { throw new MyError(); }
|
get: function() {
|
||||||
|
throw new MyError();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
args[Symbol.isConcatSpreadable] = true;
|
args[Symbol.isConcatSpreadable] = true;
|
||||||
assert.throws(MyError, function() {
|
assert.throws(MyError, function() {
|
||||||
|
|
|
@ -11,9 +11,13 @@ flags: [noStrict]
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
var args = (function(a, a, a) { return arguments; })(1,2,3);
|
var args = (function(a, a, a) {
|
||||||
|
return arguments;
|
||||||
|
})(1, 2, 3);
|
||||||
args[Symbol.isConcatSpreadable] = true;
|
args[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3]));
|
assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3]));
|
||||||
|
|
||||||
Object.defineProperty(args, "length", { value: 6 });
|
Object.defineProperty(args, "length", {
|
||||||
|
value: 6
|
||||||
|
});
|
||||||
assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0]));
|
assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0]));
|
||||||
|
|
|
@ -10,9 +10,13 @@ description: Array.prototype.concat sloppy arguments
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
var args = (function(a, b, c) { return arguments; })(1,2,3);
|
var args = (function(a, b, c) {
|
||||||
|
return arguments;
|
||||||
|
})(1, 2, 3);
|
||||||
args[Symbol.isConcatSpreadable] = true;
|
args[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3]));
|
assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3]));
|
||||||
|
|
||||||
Object.defineProperty(args, "length", { value: 6 });
|
Object.defineProperty(args, "length", {
|
||||||
|
value: 6
|
||||||
|
});
|
||||||
assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0]));
|
assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0]));
|
||||||
|
|
|
@ -31,7 +31,9 @@ function concatTypedArray(type, elems, modulo) {
|
||||||
var expected = new Array(4000);
|
var expected = new Array(4000);
|
||||||
expected[0] = defValue;
|
expected[0] = defValue;
|
||||||
|
|
||||||
Object.defineProperty(ta, "length", { value: 4000 });
|
Object.defineProperty(ta, "length", {
|
||||||
|
value: 4000
|
||||||
|
});
|
||||||
ta[Symbol.isConcatSpreadable] = true;
|
ta[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([].concat(ta), expected));
|
assert(compareArray([].concat(ta), expected));
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,9 @@ features: [Symbol.isConcatSpreadable]
|
||||||
function MyError() {}
|
function MyError() {}
|
||||||
var obj = {};
|
var obj = {};
|
||||||
Object.defineProperty(obj, Symbol.isConcatSpreadable, {
|
Object.defineProperty(obj, Symbol.isConcatSpreadable, {
|
||||||
get: function() { throw new MyError(); }
|
get: function() {
|
||||||
|
throw new MyError();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.throws(MyError, function() {
|
assert.throws(MyError, function() {
|
||||||
|
|
|
@ -10,7 +10,9 @@ description: Array.prototype.concat Symbol.isConcatSpreadable sparse object
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
var obj = { length: 5 };
|
var obj = {
|
||||||
|
length: 5
|
||||||
|
};
|
||||||
obj[Symbol.isConcatSpreadable] = true;
|
obj[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([void 0, void 0, void 0, void 0, void 0], [].concat(obj)));
|
assert(compareArray([void 0, void 0, void 0, void 0, void 0], [].concat(obj)));
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,14 @@ description: Array.prototype.concat strict arguments
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
features: [Symbol.isConcatSpreadable]
|
features: [Symbol.isConcatSpreadable]
|
||||||
---*/
|
---*/
|
||||||
var args = (function(a, b, c) { "use strict"; return arguments; })(1,2,3);
|
var args = (function(a, b, c) {
|
||||||
|
"use strict";
|
||||||
|
return arguments;
|
||||||
|
})(1, 2, 3);
|
||||||
args[Symbol.isConcatSpreadable] = true;
|
args[Symbol.isConcatSpreadable] = true;
|
||||||
assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3]));
|
assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3]));
|
||||||
|
|
||||||
Object.defineProperty(args, "length", { value: 6 });
|
Object.defineProperty(args, "length", {
|
||||||
|
value: 6
|
||||||
|
});
|
||||||
assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0]));
|
assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0]));
|
||||||
|
|
|
@ -33,7 +33,9 @@ if (arr.hasOwnProperty('1') !== true) {
|
||||||
Object.prototype[1] = 1;
|
Object.prototype[1] = 1;
|
||||||
Object.prototype.length = 2;
|
Object.prototype.length = 2;
|
||||||
Object.prototype.concat = Array.prototype.concat;
|
Object.prototype.concat = Array.prototype.concat;
|
||||||
x = {0:0};
|
x = {
|
||||||
|
0: 0
|
||||||
|
};
|
||||||
var arr = x.concat();
|
var arr = x.concat();
|
||||||
|
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
|
|
|
@ -62,4 +62,3 @@ if (b.hasOwnProperty('1') !== false) {
|
||||||
if (b.hasOwnProperty('2') !== true) {
|
if (b.hasOwnProperty('2') !== true) {
|
||||||
$ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
|
$ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,4 +62,3 @@ if (b.hasOwnProperty('1') !== false) {
|
||||||
if (b.hasOwnProperty('2') !== true) {
|
if (b.hasOwnProperty('2') !== true) {
|
||||||
$ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
|
$ERROR("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,9 @@ info: |
|
||||||
4. If isArray is false, return ? ArrayCreate(length).
|
4. If isArray is false, return ? ArrayCreate(length).
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = { length: 0 };
|
var obj = {
|
||||||
|
length: 0
|
||||||
|
};
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var result;
|
var result;
|
||||||
Object.defineProperty(obj, 'constructor', {
|
Object.defineProperty(obj, 'constructor', {
|
||||||
|
|
|
@ -17,48 +17,42 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, null),
|
[0, 1, 2, 3].copyWithin(1, 0, null), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'null value coerced to 0'
|
'null value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, NaN),
|
[0, 1, 2, 3].copyWithin(1, 0, NaN), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'NaN value coerced to 0'
|
'NaN value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, false),
|
[0, 1, 2, 3].copyWithin(1, 0, false), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'false value coerced to 0'
|
'false value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, true),
|
[0, 1, 2, 3].copyWithin(1, 0, true), [0, 0, 2, 3]
|
||||||
[0, 0, 2, 3]
|
|
||||||
),
|
),
|
||||||
'true value coerced to 1'
|
'true value coerced to 1'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, '-2'),
|
[0, 1, 2, 3].copyWithin(1, 0, '-2'), [0, 0, 1, 3]
|
||||||
[0, 0, 1, 3]
|
|
||||||
),
|
),
|
||||||
'string "-2" value coerced to integer -2'
|
'string "-2" value coerced to integer -2'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, -2.5),
|
[0, 1, 2, 3].copyWithin(1, 0, -2.5), [0, 0, 1, 3]
|
||||||
[0, 0, 1, 3]
|
|
||||||
),
|
),
|
||||||
'float -2.5 value coerced to integer -2'
|
'float -2.5 value coerced to integer -2'
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,32 +16,28 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, undefined),
|
[0, 1, 2, 3].copyWithin(1, undefined), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'undefined value coerced to 0'
|
'undefined value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, false),
|
[0, 1, 2, 3].copyWithin(1, false), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'false value coerced to 0'
|
'false value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, NaN),
|
[0, 1, 2, 3].copyWithin(1, NaN), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'NaN value coerced to 0'
|
'NaN value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, null),
|
[0, 1, 2, 3].copyWithin(1, null), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'null value coerced to 0'
|
'null value coerced to 0'
|
||||||
);
|
);
|
||||||
|
@ -49,8 +45,7 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, true),
|
[0, 1, 2, 3].copyWithin(0, true), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'true value coerced to 1'
|
'true value coerced to 1'
|
||||||
);
|
);
|
||||||
|
@ -58,24 +53,21 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, '1'),
|
[0, 1, 2, 3].copyWithin(0, '1'), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'string "1" value coerced to 1'
|
'string "1" value coerced to 1'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0.5),
|
[0, 1, 2, 3].copyWithin(1, 0.5), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'0.5 float value coerced to integer 0'
|
'0.5 float value coerced to integer 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1.5),
|
[0, 1, 2, 3].copyWithin(0, 1.5), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'1.5 float value coerced to integer 1'
|
'1.5 float value coerced to integer 1'
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,32 +16,28 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(undefined, 1),
|
[0, 1, 2, 3].copyWithin(undefined, 1), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'undefined value coerced to 0'
|
'undefined value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(false, 1),
|
[0, 1, 2, 3].copyWithin(false, 1), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'false value coerced to 0'
|
'false value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(NaN, 1),
|
[0, 1, 2, 3].copyWithin(NaN, 1), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'NaN value coerced to 0'
|
'NaN value coerced to 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(null, 1),
|
[0, 1, 2, 3].copyWithin(null, 1), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'null value coerced to 0'
|
'null value coerced to 0'
|
||||||
);
|
);
|
||||||
|
@ -49,8 +45,7 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(true, 0),
|
[0, 1, 2, 3].copyWithin(true, 0), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'true value coerced to 1'
|
'true value coerced to 1'
|
||||||
);
|
);
|
||||||
|
@ -58,24 +53,21 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin('1', 0),
|
[0, 1, 2, 3].copyWithin('1', 0), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'string "1" value coerced to 1'
|
'string "1" value coerced to 1'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0.5, 1),
|
[0, 1, 2, 3].copyWithin(0.5, 1), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'0.5 float value coerced to integer 0'
|
'0.5 float value coerced to integer 0'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1.5, 0),
|
[0, 1, 2, 3].copyWithin(1.5, 0), [0, 0, 1, 2]
|
||||||
[0, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'1.5 float value coerced to integer 1'
|
'1.5 float value coerced to integer 1'
|
||||||
);
|
);
|
||||||
|
|
|
@ -20,64 +20,56 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1, -1),
|
[0, 1, 2, 3].copyWithin(0, 1, -1), [1, 2, 2, 3]
|
||||||
[1, 2, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1, -1) -> [1, 2, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1, -1) -> [1, 2, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(2, 0, -1),
|
[0, 1, 2, 3, 4].copyWithin(2, 0, -1), [0, 1, 0, 1, 2]
|
||||||
[0, 1, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(2, 0, -1) -> [0, 1, 0, 1, 2]'
|
'[0, 1, 2, 3, 4].copyWithin(2, 0, -1) -> [0, 1, 0, 1, 2]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(1, 2, -2),
|
[0, 1, 2, 3, 4].copyWithin(1, 2, -2), [0, 2, 2, 3, 4]
|
||||||
[0, 2, 2, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(1, 2, -2) -> [0, 2, 2, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(1, 2, -2) -> [0, 2, 2, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, -2, -1),
|
[0, 1, 2, 3].copyWithin(0, -2, -1), [2, 1, 2, 3]
|
||||||
[2, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, -2, -1) -> [2, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, -2, -1) -> [2, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(2, -2, -1),
|
[0, 1, 2, 3, 4].copyWithin(2, -2, -1), [0, 1, 3, 3, 4]
|
||||||
[0, 1, 3, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(2, -2, 1) -> [0, 1, 3, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(2, -2, 1) -> [0, 1, 3, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-3, -2, -1),
|
[0, 1, 2, 3].copyWithin(-3, -2, -1), [0, 2, 2, 3]
|
||||||
[0, 2, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-3, -2, -1) -> [0, 2, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(-3, -2, -1) -> [0, 2, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(-2, -3, -1),
|
[0, 1, 2, 3, 4].copyWithin(-2, -3, -1), [0, 1, 2, 2, 3]
|
||||||
[0, 1, 2, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(-2, -3, -1) -> [0, 1, 2, 2, 3]'
|
'[0, 1, 2, 3, 4].copyWithin(-2, -3, -1) -> [0, 1, 2, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(-5, -2, -1),
|
[0, 1, 2, 3, 4].copyWithin(-5, -2, -1), [3, 1, 2, 3, 4]
|
||||||
[3, 1, 2, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) -> [3, 1, 2, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) -> [3, 1, 2, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -20,80 +20,70 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1, -10),
|
[0, 1, 2, 3].copyWithin(0, 1, -10), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1, -10) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1, -10) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, -2, -10),
|
[0, 1, 2, 3].copyWithin(0, -2, -10), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, -2, -10) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, -2, -10) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, -9, -10),
|
[0, 1, 2, 3].copyWithin(0, -9, -10), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, -9, -10) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, -9, -10) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-3, -2, -10),
|
[0, 1, 2, 3].copyWithin(-3, -2, -10), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-3, -2, -10) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(-3, -2, -10) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-7, -8, -9),
|
[0, 1, 2, 3].copyWithin(-7, -8, -9), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-7, -8, -9) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(-7, -8, -9) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,32 +17,28 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, -10),
|
[0, 1, 2, 3].copyWithin(0, -10), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, -10) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, -10) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(0, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(0, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(0, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(0, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(2, -10),
|
[0, 1, 2, 3, 4].copyWithin(2, -10), [0, 1, 0, 1, 2]
|
||||||
[0, 1, 0, 1, 2]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 0, 1, 2]'
|
'[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 0, 1, 2]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(2, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(2, -Infinity), [1, 2, 1, 2, 3]
|
||||||
[1, 2, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(2, -Infinity) -> [1, 2, 1, 2, 3]'
|
'[1, 2, 3, 4, 5].copyWithin(2, -Infinity) -> [1, 2, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
@ -50,16 +46,14 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(10, -10),
|
[0, 1, 2, 3, 4].copyWithin(10, -10), [0, 1, 2, 3, 4]
|
||||||
[0, 1, 2, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(10, -10) -> [0, 1, 2, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(10, -10) -> [0, 1, 2, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(10, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(10, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(10, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(10, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
@ -67,16 +61,14 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-9, -10),
|
[0, 1, 2, 3].copyWithin(-9, -10), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-9, -10) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(-9, -10) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(-9, -Infinity),
|
[1, 2, 3, 4, 5].copyWithin(-9, -Infinity), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,32 +17,28 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-10, 0),
|
[0, 1, 2, 3].copyWithin(-10, 0), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-10, 0) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(-10, 0) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(-Infinity, 0),
|
[1, 2, 3, 4, 5].copyWithin(-Infinity, 0), [1, 2, 3, 4, 5]
|
||||||
[1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(-Infinity, 0) -> [1, 2, 3, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(-Infinity, 0) -> [1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(-10, 2),
|
[0, 1, 2, 3, 4].copyWithin(-10, 2), [2, 3, 4, 3, 4]
|
||||||
[2, 3, 4, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(-10, 2) -> [2, 3, 4, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(-10, 2) -> [2, 3, 4, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[1, 2, 3, 4, 5].copyWithin(-Infinity, 2),
|
[1, 2, 3, 4, 5].copyWithin(-Infinity, 2), [3, 4, 5, 4, 5]
|
||||||
[3, 4, 5, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) -> [3, 4, 5, 4, 5]'
|
'[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) -> [3, 4, 5, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,48 +17,42 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, -1),
|
[0, 1, 2, 3].copyWithin(0, -1), [3, 1, 2, 3]
|
||||||
[3, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, -1) -> [3, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, -1) -> [3, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(2, -2),
|
[0, 1, 2, 3, 4].copyWithin(2, -2), [0, 1, 3, 4, 4]
|
||||||
[0, 1, 3, 4, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 3, 4, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 3, 4, 4]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(1, -2),
|
[0, 1, 2, 3, 4].copyWithin(1, -2), [0, 3, 4, 3, 4]
|
||||||
[0, 3, 4, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(1, -2) -> [0, 3, 4, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(1, -2) -> [0, 3, 4, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-1, -2),
|
[0, 1, 2, 3].copyWithin(-1, -2), [0, 1, 2, 2]
|
||||||
[0, 1, 2, 2]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-1, -2) -> [ 0, 1, 2, 2 ]'
|
'[0, 1, 2, 3].copyWithin(-1, -2) -> [ 0, 1, 2, 2 ]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(-2, -3),
|
[0, 1, 2, 3, 4].copyWithin(-2, -3), [0, 1, 2, 2, 3]
|
||||||
[0, 1, 2, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(-2, -3) -> [0, 1, 2, 2, 3]'
|
'[0, 1, 2, 3, 4].copyWithin(-2, -3) -> [0, 1, 2, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(-5, -2),
|
[0, 1, 2, 3, 4].copyWithin(-5, -2), [3, 4, 2, 3, 4]
|
||||||
[3, 4, 2, 3, 4]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(-5, -2) -> [3, 4, 2, 3, 4]'
|
'[0, 1, 2, 3, 4].copyWithin(-5, -2) -> [3, 4, 2, 3, 4]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,24 +17,21 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-1, 0),
|
[0, 1, 2, 3].copyWithin(-1, 0), [0, 1, 2, 0]
|
||||||
[0, 1, 2, 0]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-1, 0) -> [0, 1, 2, 0]'
|
'[0, 1, 2, 3].copyWithin(-1, 0) -> [0, 1, 2, 0]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4].copyWithin(-2, 2),
|
[0, 1, 2, 3, 4].copyWithin(-2, 2), [0, 1, 2, 2, 3]
|
||||||
[0, 1, 2, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4].copyWithin(-2, 2) -> [0, 1, 2, 2, 3]'
|
'[0, 1, 2, 3, 4].copyWithin(-2, 2) -> [0, 1, 2, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(-1, 2),
|
[0, 1, 2, 3].copyWithin(-1, 2), [0, 1, 2, 2]
|
||||||
[0, 1, 2, 2]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(-1, 2) -> [0, 1, 2, 2]'
|
'[0, 1, 2, 3].copyWithin(-1, 2) -> [0, 1, 2, 2]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,32 +36,28 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1, 6),
|
[0, 1, 2, 3].copyWithin(0, 1, 6), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1, Infinity),
|
[0, 1, 2, 3].copyWithin(0, 1, Infinity), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1, Infinity) -> [1, 2, 3, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1, Infinity) -> [1, 2, 3, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6),
|
[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6), [0, 3, 4, 5, 4, 5]
|
||||||
[0, 3, 4, 5, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) -> [0, 3, 4, 5, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) -> [0, 3, 4, 5, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity),
|
[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity), [0, 3, 4, 5, 4, 5]
|
||||||
[0, 3, 4, 5, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [0, 3, 4, 5, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [0, 3, 4, 5, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -30,64 +30,56 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(6, 0),
|
[0, 1, 2, 3, 4, 5].copyWithin(6, 0), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(7, 0),
|
[0, 1, 2, 3, 4, 5].copyWithin(7, 0), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0),
|
[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(6, 2),
|
[0, 1, 2, 3, 4, 5].copyWithin(6, 2), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(6, 2) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(6, 2) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(7, 2),
|
[0, 1, 2, 3, 4, 5].copyWithin(7, 2), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(7, 2) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(7, 2) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2),
|
[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(0, 6),
|
[0, 1, 2, 3, 4, 5].copyWithin(0, 6), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(0, 6) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(0, 6) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(0, 7),
|
[0, 1, 2, 3, 4, 5].copyWithin(0, 7), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(0, 7) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(0, 7) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
@ -95,24 +87,21 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity),
|
[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(2, 6),
|
[0, 1, 2, 3, 4, 5].copyWithin(2, 6), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(2, 6) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(2, 6) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(1, 7),
|
[0, 1, 2, 3, 4, 5].copyWithin(1, 7), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(1, 7) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(1, 7) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
@ -120,32 +109,28 @@ assert(
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity),
|
[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(6, 6),
|
[0, 1, 2, 3, 4, 5].copyWithin(6, 6), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(6, 6) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(6, 6) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(10, 10),
|
[0, 1, 2, 3, 4, 5].copyWithin(10, 10), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(10, 10) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(10, 10) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity),
|
[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity), [0, 1, 2, 3, 4, 5]
|
||||||
[0, 1, 2, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) => [0, 1, 2, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) => [0, 1, 2, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -34,28 +34,24 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0),
|
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0), ['a', 'b', 'c', 'd', 'e', 'f']
|
||||||
['a', 'b', 'c', 'd', 'e', 'f']
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2),
|
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2), ['c', 'd', 'e', 'f', 'e', 'f']
|
||||||
['c', 'd', 'e', 'f', 'e', 'f']
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0),
|
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0), ['a', 'b', 'c', 'a', 'b', 'c']
|
||||||
['a', 'b', 'c', 'a', 'b', 'c']
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(1, 4),
|
[0, 1, 2, 3, 4, 5].copyWithin(1, 4), [0, 4, 5, 3, 4, 5]
|
||||||
[0, 4, 5, 3, 4, 5]
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,24 +36,21 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 0, 0),
|
[0, 1, 2, 3].copyWithin(0, 0, 0), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 0, 0) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 0, 0) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 0, 2),
|
[0, 1, 2, 3].copyWithin(0, 0, 2), [0, 1, 2, 3]
|
||||||
[0, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 0, 2) -> [0, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 0, 2) -> [0, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1, 2),
|
[0, 1, 2, 3].copyWithin(0, 1, 2), [1, 1, 2, 3]
|
||||||
[1, 1, 2, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1, 2) -> [1, 1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1, 2) -> [1, 1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
@ -71,16 +68,14 @@ assert(
|
||||||
*/
|
*/
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(1, 0, 2),
|
[0, 1, 2, 3].copyWithin(1, 0, 2), [0, 0, 1, 3]
|
||||||
[0, 0, 1, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(1, 0, 2) -> [0, 0, 1, 3]'
|
'[0, 1, 2, 3].copyWithin(1, 0, 2) -> [0, 0, 1, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5),
|
[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5), [0, 3, 4, 3, 4, 5]
|
||||||
[0, 3, 4, 3, 4, 5]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) -> [0, 3, 4, 3, 4, 5]'
|
'[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) -> [0, 3, 4, 3, 4, 5]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -23,4 +23,3 @@ var o1 = {
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
[].copyWithin(0, 0, o1);
|
[].copyWithin(0, 0, o1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,4 +22,3 @@ var o1 = {
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
[].copyWithin(0, o1);
|
[].copyWithin(0, o1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,16 +17,14 @@ includes: [compareArray.js]
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1, undefined),
|
[0, 1, 2, 3].copyWithin(0, 1, undefined), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1, undefined) -> [1, 2, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1, undefined) -> [1, 2, 3]'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
compareArray(
|
compareArray(
|
||||||
[0, 1, 2, 3].copyWithin(0, 1),
|
[0, 1, 2, 3].copyWithin(0, 1), [1, 2, 3, 3]
|
||||||
[1, 2, 3, 3]
|
|
||||||
),
|
),
|
||||||
'[0, 1, 2, 3].copyWithin(0, 1) -> [1, 2, 3, 3]'
|
'[0, 1, 2, 3].copyWithin(0, 1) -> [1, 2, 3, 3]'
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,6 +8,7 @@ description: Array.prototype.every applied to Boolean object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj) {
|
function callbackfn(val, idx, obj) {
|
||||||
accessed = true;
|
accessed = true;
|
||||||
return obj instanceof Boolean;
|
return obj instanceof Boolean;
|
||||||
|
|
|
@ -8,6 +8,7 @@ description: Array.prototype.every applied to number primitive
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj) {
|
function callbackfn(val, idx, obj) {
|
||||||
accessed = true;
|
accessed = true;
|
||||||
return obj instanceof Number;
|
return obj instanceof Number;
|
||||||
|
|
|
@ -8,6 +8,7 @@ description: Array.prototype.every applied to Number object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj) {
|
function callbackfn(val, idx, obj) {
|
||||||
accessed = true;
|
accessed = true;
|
||||||
return obj instanceof Number;
|
return obj instanceof Number;
|
||||||
|
|
|
@ -23,7 +23,10 @@ Object.defineProperty(Object.prototype, "length", {
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var obj = { 0: 9, 1: 8 };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
1: 8
|
||||||
|
};
|
||||||
Object.defineProperty(obj, "length", {
|
Object.defineProperty(obj, "length", {
|
||||||
set: function() {},
|
set: function() {},
|
||||||
configurable: true
|
configurable: true
|
||||||
|
|
|
@ -16,7 +16,10 @@ function callbackfn(val, idx, obj) {
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12 };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -17,7 +17,9 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var proto = { length: 3 };
|
var proto = {
|
||||||
|
length: 3
|
||||||
|
};
|
||||||
|
|
||||||
var Con = function() {};
|
var Con = function() {};
|
||||||
Con.prototype = proto;
|
Con.prototype = proto;
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var arrProtoLen = 0;
|
var arrProtoLen = 0;
|
||||||
|
|
||||||
function callbackfn1(val, idx, obj) {
|
function callbackfn1(val, idx, obj) {
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,9 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var proto = { length: 2 };
|
var proto = {
|
||||||
|
length: 2
|
||||||
|
};
|
||||||
|
|
||||||
var Con = function() {};
|
var Con = function() {};
|
||||||
Con.prototype = proto;
|
Con.prototype = proto;
|
||||||
|
|
|
@ -17,7 +17,9 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var proto = { length: 3 };
|
var proto = {
|
||||||
|
length: 3
|
||||||
|
};
|
||||||
|
|
||||||
var Con = function() {};
|
var Con = function() {};
|
||||||
Con.prototype = proto;
|
Con.prototype = proto;
|
||||||
|
|
|
@ -14,7 +14,10 @@ function callbackfn(val, idx, obj) {
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: undefined };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: undefined
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -16,7 +16,10 @@ function callbackfn(val, idx, obj) {
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: NaN };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: NaN
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: "2" };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: "2"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12,
|
||||||
|
2: 9,
|
||||||
|
length: "-4294967294"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
||||||
|
|
|
@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: "2.5"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -14,9 +14,18 @@ function callbackfn(val, idx, obj) {
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var objOne = { 0: 9, length: "Infinity" };
|
var objOne = {
|
||||||
var objTwo = { 0: 9, length: "+Infinity" };
|
0: 9,
|
||||||
var objThree = { 0: 9, length: "-Infinity" };
|
length: "Infinity"
|
||||||
|
};
|
||||||
|
var objTwo = {
|
||||||
|
0: 9,
|
||||||
|
length: "+Infinity"
|
||||||
|
};
|
||||||
|
var objThree = {
|
||||||
|
0: 9,
|
||||||
|
length: "-Infinity"
|
||||||
|
};
|
||||||
|
|
||||||
assert.sameValue(Array.prototype.every.call(objOne, callbackfn), false, 'Array.prototype.every.call(objOne, callbackfn)');
|
assert.sameValue(Array.prototype.every.call(objOne, callbackfn), false, 'Array.prototype.every.call(objOne, callbackfn)');
|
||||||
assert.sameValue(Array.prototype.every.call(objTwo, callbackfn), false, 'Array.prototype.every.call(objTwo, callbackfn)');
|
assert.sameValue(Array.prototype.every.call(objTwo, callbackfn), false, 'Array.prototype.every.call(objTwo, callbackfn)');
|
||||||
|
|
|
@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: "2E0"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: "0x0002"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -17,7 +17,12 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: "0002.00"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -16,7 +16,11 @@ function callbackfn(val, idx, obj) {
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, 1: 8, length: "two" };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
1: 8,
|
||||||
|
length: "two"
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -17,7 +17,11 @@ function callbackfn2(val, idx, obj) {
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 9, length: true };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 9,
|
||||||
|
length: true
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -17,7 +17,12 @@ description: >
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: 2.685
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -14,7 +14,10 @@ description: Array.prototype.every - value of 'length' is a number (value is 0)
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: 0 };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: 0
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -14,7 +14,10 @@ description: Array.prototype.every - value of 'length' is a number (value is +0)
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: +0 };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: +0
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -14,7 +14,10 @@ description: Array.prototype.every - value of 'length' is a number (value is -0)
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: -0 };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: -0
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -17,7 +17,12 @@ description: >
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: 2 };
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: 2
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||||
|
|
|
@ -17,7 +17,12 @@ description: >
|
||||||
return val > 11;
|
return val > 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 12, 1: 11, 2: 9, length: -4294967294 }; //length used to exec while loop is 0
|
var obj = {
|
||||||
|
0: 12,
|
||||||
|
1: 11,
|
||||||
|
2: 9,
|
||||||
|
length: -4294967294
|
||||||
|
}; //length used to exec while loop is 0
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||||
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
||||||
|
|
|
@ -16,7 +16,10 @@ description: >
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: Infinity };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: Infinity
|
||||||
|
};
|
||||||
|
|
||||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||||
assert(accessed, 'accessed !== true');
|
assert(accessed, 'accessed !== true');
|
||||||
|
|
|
@ -16,7 +16,10 @@ description: >
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 9, length: -Infinity };
|
var obj = {
|
||||||
|
0: 9,
|
||||||
|
length: -Infinity
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -9,7 +9,10 @@ description: >
|
||||||
was thrown by step 2
|
was thrown by step 2
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12 };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12
|
||||||
|
};
|
||||||
|
|
||||||
Object.defineProperty(obj, "length", {
|
Object.defineProperty(obj, "length", {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
|
|
@ -9,7 +9,10 @@ description: >
|
||||||
was thrown by step 3
|
was thrown by step 3
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12 };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12
|
||||||
|
};
|
||||||
|
|
||||||
Object.defineProperty(obj, "length", {
|
Object.defineProperty(obj, "length", {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
|
|
@ -9,7 +9,9 @@ description: >
|
||||||
passing undefined for callbackfn
|
passing undefined for callbackfn
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = { 10: 10 };
|
var obj = {
|
||||||
|
10: 10
|
||||||
|
};
|
||||||
var lengthAccessed = false;
|
var lengthAccessed = false;
|
||||||
var loopAccessed = false;
|
var loopAccessed = false;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,10 @@ description: >
|
||||||
visible when an exception occurs
|
visible when an exception occurs
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12 };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12
|
||||||
|
};
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,10 @@ description: >
|
||||||
visible when an exception occurs
|
visible when an exception occurs
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12 };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12
|
||||||
|
};
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: Array.prototype.every - thisArg is Object
|
||||||
var res = false;
|
var res = false;
|
||||||
var o = new Object();
|
var o = new Object();
|
||||||
o.res = true;
|
o.res = true;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj)
|
function callbackfn(val, idx, obj)
|
||||||
{
|
{
|
||||||
return this.res;
|
return this.res;
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: Array.prototype.every - thisArg is Array
|
||||||
var res = false;
|
var res = false;
|
||||||
var a = new Array();
|
var a = new Array();
|
||||||
a.res = true;
|
a.res = true;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj)
|
function callbackfn(val, idx, obj)
|
||||||
{
|
{
|
||||||
return this.res;
|
return this.res;
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var res = false;
|
var res = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj)
|
function callbackfn(val, idx, obj)
|
||||||
{
|
{
|
||||||
return this.res;
|
return this.res;
|
||||||
|
|
|
@ -8,6 +8,7 @@ description: Array.prototype.every - thisArg is object from object template
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var res = false;
|
var res = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj)
|
function callbackfn(val, idx, obj)
|
||||||
{
|
{
|
||||||
return this.res;
|
return this.res;
|
||||||
|
|
|
@ -8,6 +8,7 @@ description: Array.prototype.every - thisArg is function
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var res = false;
|
var res = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj)
|
function callbackfn(val, idx, obj)
|
||||||
{
|
{
|
||||||
return this.res;
|
return this.res;
|
||||||
|
|
|
@ -14,7 +14,11 @@ description: Array.prototype.every - no observable effects occur if len is 0
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 0: 11, 1: 12, length: 0 };
|
var obj = {
|
||||||
|
0: 11,
|
||||||
|
1: 12,
|
||||||
|
length: 0
|
||||||
|
};
|
||||||
|
|
||||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||||
assert.sameValue(accessed, false, 'accessed');
|
assert.sameValue(accessed, false, 'accessed');
|
||||||
|
|
|
@ -16,7 +16,11 @@ description: >
|
||||||
return val > 10;
|
return val > 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
var obj = { 1: 12, 2: 9, length: 2 };
|
var obj = {
|
||||||
|
1: 12,
|
||||||
|
2: 9,
|
||||||
|
length: 2
|
||||||
|
};
|
||||||
|
|
||||||
Object.defineProperty(obj, "0", {
|
Object.defineProperty(obj, "0", {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCnt = 0.;
|
var callCnt = 0.;
|
||||||
|
|
||||||
function callbackfn(val, Idx, obj)
|
function callbackfn(val, Idx, obj)
|
||||||
{
|
{
|
||||||
callCnt++;
|
callCnt++;
|
||||||
|
|
|
@ -10,11 +10,15 @@ description: >
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj) {
|
function callbackfn(val, idx, obj) {
|
||||||
accessed = true;
|
accessed = true;
|
||||||
return idx !== 1;
|
return idx !== 1;
|
||||||
}
|
}
|
||||||
var arr = { 2: 2, length: 20 };
|
var arr = {
|
||||||
|
2: 2,
|
||||||
|
length: 20
|
||||||
|
};
|
||||||
|
|
||||||
Object.defineProperty(arr, "0", {
|
Object.defineProperty(arr, "0", {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj) {
|
function callbackfn(val, idx, obj) {
|
||||||
accessed = true;
|
accessed = true;
|
||||||
return idx !== 1;
|
return idx !== 1;
|
||||||
|
|
|
@ -17,7 +17,12 @@ description: >
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var arr = { 0: 0, 1: 111, 2: 2, length: 10 };
|
var arr = {
|
||||||
|
0: 0,
|
||||||
|
1: 111,
|
||||||
|
2: 2,
|
||||||
|
length: 10
|
||||||
|
};
|
||||||
|
|
||||||
Object.defineProperty(arr, "0", {
|
Object.defineProperty(arr, "0", {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var accessed = false;
|
var accessed = false;
|
||||||
|
|
||||||
function callbackfn(val, idx, obj) {
|
function callbackfn(val, idx, obj) {
|
||||||
accessed = true;
|
accessed = true;
|
||||||
return idx !== 3;
|
return idx !== 3;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue