Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)

This reverts commit a01de4a722d088055a7d84d8c691ddd7109edb34.
This commit is contained in:
André Bargull 2018-02-09 09:09:47 -08:00 committed by Leo Balter
parent a01de4a722
commit f95b56ab28
8371 changed files with 56286 additions and 64399 deletions

View File

@ -11,11 +11,7 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String)
//CHECK#1 //CHECK#1
var x = []; var x = [];
var object = { var object = {valueOf: function() {return 1}};
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]"]));
@ -23,14 +19,7 @@ if (x["[object Object]"] !== 0) {
//CHECK#2 //CHECK#2
x = []; x = [];
var object = { var object = {valueOf: function() {return 1}, toString: function() {return 0}};
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]));
@ -38,14 +27,7 @@ if (x[0] !== 0) {
//CHECK#3 //CHECK#3
x = []; x = [];
var object = { var object = {valueOf: function() {return 1}, toString: function() {return {}}};
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]));
@ -54,14 +36,7 @@ if (x[1] !== 0) {
//CHECK#4 //CHECK#4
try { try {
x = []; x = [];
var object = { var object = {valueOf: function() {throw "error"}, toString: function() {return 1}};
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]));
@ -77,11 +52,7 @@ catch (e) {
//CHECK#5 //CHECK#5
x = []; x = [];
var object = { var object = {toString: function() {return 1}};
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]));
@ -89,14 +60,7 @@ if (x[1] !== 0) {
//CHECK#6 //CHECK#6
x = []; x = [];
var object = { var object = {valueOf: function() {return {}}, toString: function() {return 1}}
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]));
@ -105,14 +69,7 @@ if (x[1] !== 0) {
//CHECK#7 //CHECK#7
try { try {
x = []; x = [];
var object = { var object = {valueOf: function() {return 1}, toString: function() {throw "error"}};
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]));
} }
@ -125,14 +82,7 @@ catch (e) {
//CHECK#8 //CHECK#8
try { try {
x = []; x = [];
var object = { var object = {valueOf: function() {return {}}, toString: function() {return {}}};
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]));
} }

View File

@ -28,9 +28,7 @@ function MyCollection() {
this.args = arguments; this.args = arguments;
} }
result = Array.from.call(MyCollection, { result = Array.from.call(MyCollection, {length: 42});
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);

View File

@ -20,7 +20,6 @@ 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 + ".");

View File

@ -13,7 +13,6 @@ 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 + ".");

View File

@ -9,7 +9,6 @@ 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) {

View File

@ -27,9 +27,7 @@ var items = {};
items[Symbol.iterator] = function() { items[Symbol.iterator] = function() {
return { return {
next: function() { next: function() {
return { return { done: true };
done: true
};
} }
}; };
}; };

View File

@ -26,14 +26,8 @@ features: [Symbol.iterator]
---*/ ---*/
var args = []; var args = [];
var firstResult = { var firstResult = { done: false, value: {} };
done: false, var secondResult = { done: false, value: {} };
value: {}
};
var secondResult = {
done: false,
value: {}
};
var mapFn = function(value, idx) { var mapFn = function(value, idx) {
args.push(arguments); args.push(arguments);
}; };
@ -46,9 +40,7 @@ items[Symbol.iterator] = function() {
next: function() { next: function() {
var result = nextResult; var result = nextResult;
nextResult = nextNextResult; nextResult = nextNextResult;
nextNextResult = { nextNextResult = { done: true };
done: true
};
return result; return result;
} }

View File

@ -25,14 +25,8 @@ features: [Symbol.iterator]
---*/ ---*/
var thisVals = []; var thisVals = [];
var nextResult = { var nextResult = { done: false, value: {} };
done: false, var nextNextResult = { done: false, value: {} };
value: {}
};
var nextNextResult = {
done: false,
value: {}
};
var firstReturnVal = {}; var firstReturnVal = {};
var secondReturnVal = {}; var secondReturnVal = {};
var mapFn = function(value, idx) { var mapFn = function(value, idx) {
@ -51,9 +45,7 @@ items[Symbol.iterator] = function() {
next: function() { next: function() {
var result = nextResult; var result = nextResult;
nextResult = nextNextResult; nextResult = nextNextResult;
nextNextResult = { nextNextResult = { done: true };
done: true
};
return result; return result;
} }

View File

@ -23,14 +23,8 @@ features: [Symbol.iterator]
---*/ ---*/
var thisVals = []; var thisVals = [];
var nextResult = { var nextResult = { done: false, value: {} };
done: false, var nextNextResult = { done: false, value: {} };
value: {}
};
var nextNextResult = {
done: false,
value: {}
};
var mapFn = function() { var mapFn = function() {
thisVals.push(this); thisVals.push(this);
}; };
@ -42,9 +36,7 @@ items[Symbol.iterator] = function() {
next: function() { next: function() {
var result = nextResult; var result = nextResult;
nextResult = nextNextResult; nextResult = nextNextResult;
nextNextResult = { nextNextResult = { done: true };
done: true
};
return result; return result;
} }

View File

@ -24,30 +24,20 @@ flags: [noStrict]
---*/ ---*/
var thisVals = []; var thisVals = [];
var nextResult = { var nextResult = { done: false, value: {} };
done: false, var nextNextResult = { done: false, value: {} };
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() { var global = function() { return this; }();
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 = { nextNextResult = { done: true };
done: true
};
return result; return result;
} }

View File

@ -24,14 +24,8 @@ flags: [onlyStrict]
---*/ ---*/
var thisVals = []; var thisVals = [];
var nextResult = { var nextResult = { done: false, value: {} };
done: false, var nextNextResult = { done: false, value: {} };
value: {}
};
var nextNextResult = {
done: false,
value: {}
};
var mapFn = function() { var mapFn = function() {
thisVals.push(this); thisVals.push(this);
}; };
@ -42,9 +36,7 @@ items[Symbol.iterator] = function() {
next: function() { next: function() {
var result = nextResult; var result = nextResult;
nextResult = nextNextResult; nextResult = nextNextResult;
nextNextResult = { nextNextResult = { done: true };
done: true
};
return result; return result;
} }

View File

@ -18,15 +18,11 @@ features: [Symbol.iterator]
---*/ ---*/
var C = function() { var C = function() {
Object.defineProperty(this, '0', { Object.defineProperty(this, '0', { configurable: false });
configurable: false
});
}; };
var closeCount = 0; var closeCount = 0;
var items = {}; var items = {};
var nextResult = { var nextResult = { done: false };
done: false
};
items[Symbol.iterator] = function() { items[Symbol.iterator] = function() {
return { return {
@ -36,9 +32,7 @@ items[Symbol.iterator] = function() {
next: function() { next: function() {
var result = nextResult; var result = nextResult;
nextResult = { nextResult = { done: true };
done: true
};
return result; return result;
} }

View File

@ -16,18 +16,9 @@ features: [Symbol.iterator]
---*/ ---*/
var items = {}; var items = {};
var firstIterResult = { var firstIterResult = { done: false, value: {} };
done: false, var secondIterResult = { done: false, value: {} };
value: {} var thirdIterResult = { done: true, 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;

View File

@ -25,11 +25,7 @@ Object.defineProperty(C.prototype, 'length', {
}); });
items[Symbol.iterator] = function() { items[Symbol.iterator] = function() {
return { return {
next: function() { next: function() { return { done: true }; }
return {
done: true
};
}
}; };
}; };

View File

@ -29,19 +29,13 @@ items[Symbol.iterator] = function() {
}; };
}; };
nextIterResult = lastIterResult = { nextIterResult = lastIterResult = { done: true };
done: true
};
result = Array.from(items); result = Array.from(items);
assert.sameValue(result.length, 0); assert.sameValue(result.length, 0);
nextIterResult = { nextIterResult = { done: false };
done: false lastIterResult = { done: true };
};
lastIterResult = {
done: true
};
result = Array.from(items); result = Array.from(items);
assert.sameValue(result.length, 1); assert.sameValue(result.length, 1);

View File

@ -8,11 +8,8 @@ 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() { assert.throws(Test262Error, function(){Array.from(array, mapFn);});
Array.from(array, mapFn);
});

View File

@ -9,7 +9,6 @@ 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 + ".");

View File

@ -27,6 +27,4 @@ var obj = {
}; };
} }
}; };
assert.throws(Test262Error, function() { assert.throws(Test262Error, function(){Array.from(obj);});
Array.from(obj);
});

View File

@ -9,8 +9,4 @@ description: >
indexed properties indexed properties
---*/ ---*/
assert.sameValue(Array.isArray({ assert.sameValue(Array.isArray({ 0: 12, 1: 9, length: 2 }), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })');
0: 12,
1: 9,
length: 2
}), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })');

View File

@ -10,39 +10,21 @@ description: Uint32 use ToNumber and ToPrimitve
//CHECK#1 //CHECK#1
var x = []; var x = [];
x.length = { x.length = {valueOf: function() {return 2}};
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 = { x.length = {valueOf: function() {return 2}, toString: function() {return 1}};
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 = { x.length = {valueOf: function() {return 2}, toString: function() {return {}}};
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));
} }
@ -50,14 +32,7 @@ if (x.length !== 2) {
//CHECK#4 //CHECK#4
try { try {
x = []; x = [];
x.length = { x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}};
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));
} }
@ -72,25 +47,14 @@ catch (e) {
//CHECK#5 //CHECK#5
x = []; x = [];
x.length = { x.length = {toString: function() {return 1}};
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 = { x.length = {valueOf: function() {return {}}, toString: function() {return 1}}
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));
} }
@ -98,14 +62,7 @@ if (x.length !== 1) {
//CHECK#7 //CHECK#7
try { try {
x = []; x = [];
x.length = { x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}};
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));
} }
@ -118,14 +75,7 @@ catch (e) {
//CHECK#8 //CHECK#8
try { try {
x = []; x = [];
x.length = { x.length = {valueOf: function() {return {}}, toString: function() {return {}}};
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));
} }

View File

@ -10,11 +10,9 @@ features: [Symbol.isConcatSpreadable]
---*/ ---*/
function MyError() {} function MyError() {}
var obj = { var obj = {
"length": { "length": { toString: function() {
toString: function() {
throw new MyError(); throw new MyError();
}, }, valueOf: null
valueOf: null
}, },
"1": "A", "1": "A",
"3": "B", "3": "B",

View File

@ -15,17 +15,7 @@ var obj = {
"5": "C" "5": "C"
}; };
obj[Symbol.isConcatSpreadable] = true; obj[Symbol.isConcatSpreadable] = true;
obj.length = { obj.length = {toString: function() { return "SIX"; }, valueOf: null };
toString: function() {
return "SIX";
},
valueOf: null
};
assert(compareArray([].concat(obj), [])); assert(compareArray([].concat(obj), []));
obj.length = { obj.length = {toString: null, valueOf: function() { return "SIX"; } };
toString: null,
valueOf: function() {
return "SIX";
}
};
assert(compareArray([].concat(obj), [])); assert(compareArray([].concat(obj), []));

View File

@ -16,12 +16,7 @@ var obj = {
"5": "C" "5": "C"
}; };
obj[Symbol.isConcatSpreadable] = true; obj[Symbol.isConcatSpreadable] = true;
var obj2 = { var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" };
length: 3,
"0": "0",
"1": "1",
"2": "2"
};
var arr = ["X", "Y", "Z"]; var arr = ["X", "Y", "Z"];
var expected = [ var expected = [

View File

@ -9,21 +9,13 @@ description: Array.prototype.concat array like to length throws
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
var obj = { var obj = {
"length": { "length": {valueOf: null, toString: null},
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 = { var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" };
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);

View File

@ -17,12 +17,7 @@ var obj = {
"5": "C" "5": "C"
}; };
obj[Symbol.isConcatSpreadable] = true; obj[Symbol.isConcatSpreadable] = true;
var obj2 = { var obj2 = { length: 3, "0": "0", "1": "1", "2": "2" };
length: 3,
"0": "0",
"1": "1",
"2": "2"
};
var arr = ["X", "Y", "Z"]; var arr = ["X", "Y", "Z"];
var expected = [ var expected = [

View File

@ -10,9 +10,7 @@ description: Array.prototype.concat holey sloppy arguments
includes: [compareArray.js] includes: [compareArray.js]
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
var args = (function(a) { var args = (function(a) { return arguments; })(1,2,3);
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)));

View File

@ -31,9 +31,7 @@ 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", { Object.defineProperty(ta, "length", { value: 4000 });
value: 4000
});
ta[Symbol.isConcatSpreadable] = true; ta[Symbol.isConcatSpreadable] = true;
assert(compareArray([].concat(ta), expected)); assert(compareArray([].concat(ta), expected));
} }

View File

@ -13,9 +13,7 @@ function MyError() {}
var obj = {}; var obj = {};
obj[Symbol.isConcatSpreadable] = true; obj[Symbol.isConcatSpreadable] = true;
Object.defineProperty(obj, "length", { Object.defineProperty(obj, "length", {
get: function() { get: function() { throw new MyError(); }
throw new MyError();
}
}); });
assert.throws(MyError, function() { assert.throws(MyError, function() {

View File

@ -10,13 +10,9 @@ description: Array.prototype.concat sloppy arguments throws
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
function MyError() {} function MyError() {}
var args = (function(a) { var args = (function(a) { return arguments; })(1,2,3);
return arguments;
})(1, 2, 3);
Object.defineProperty(args, 0, { Object.defineProperty(args, 0, {
get: function() { get: function() { throw new MyError(); }
throw new MyError();
}
}); });
args[Symbol.isConcatSpreadable] = true; args[Symbol.isConcatSpreadable] = true;
assert.throws(MyError, function() { assert.throws(MyError, function() {

View File

@ -11,13 +11,9 @@ flags: [noStrict]
includes: [compareArray.js] includes: [compareArray.js]
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
var args = (function(a, a, a) { var args = (function(a, a, a) { return arguments; })(1,2,3);
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", { Object.defineProperty(args, "length", { value: 6 });
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]));

View File

@ -10,13 +10,9 @@ description: Array.prototype.concat sloppy arguments
includes: [compareArray.js] includes: [compareArray.js]
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
var args = (function(a, b, c) { var args = (function(a, b, c) { return arguments; })(1,2,3);
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", { Object.defineProperty(args, "length", { value: 6 });
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]));

View File

@ -31,9 +31,7 @@ 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", { Object.defineProperty(ta, "length", { value: 4000 });
value: 4000
});
ta[Symbol.isConcatSpreadable] = true; ta[Symbol.isConcatSpreadable] = true;
assert(compareArray([].concat(ta), expected)); assert(compareArray([].concat(ta), expected));
} }

View File

@ -12,9 +12,7 @@ features: [Symbol.isConcatSpreadable]
function MyError() {} function MyError() {}
var obj = {}; var obj = {};
Object.defineProperty(obj, Symbol.isConcatSpreadable, { Object.defineProperty(obj, Symbol.isConcatSpreadable, {
get: function() { get: function() { throw new MyError(); }
throw new MyError();
}
}); });
assert.throws(MyError, function() { assert.throws(MyError, function() {

View File

@ -10,9 +10,7 @@ description: Array.prototype.concat Symbol.isConcatSpreadable sparse object
includes: [compareArray.js] includes: [compareArray.js]
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
var obj = { var obj = { length: 5 };
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)));

View File

@ -10,14 +10,9 @@ description: Array.prototype.concat strict arguments
includes: [compareArray.js] includes: [compareArray.js]
features: [Symbol.isConcatSpreadable] features: [Symbol.isConcatSpreadable]
---*/ ---*/
var args = (function(a, b, c) { var args = (function(a, b, c) { "use strict"; return arguments; })(1,2,3);
"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", { Object.defineProperty(args, "length", { value: 6 });
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]));

View File

@ -33,9 +33,7 @@ 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 = { x = {0:0};
0: 0
};
var arr = x.concat(); var arr = x.concat();
//CHECK#4 //CHECK#4

View File

@ -62,3 +62,4 @@ 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'));
} }

View File

@ -62,3 +62,4 @@ 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'));
} }

View File

@ -15,9 +15,7 @@ info: |
4. If isArray is false, return ? ArrayCreate(length). 4. If isArray is false, return ? ArrayCreate(length).
---*/ ---*/
var obj = { var obj = { length: 0 };
length: 0
};
var callCount = 0; var callCount = 0;
var result; var result;
Object.defineProperty(obj, 'constructor', { Object.defineProperty(obj, 'constructor', {

View File

@ -17,42 +17,48 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(1, 0, null), [0, 1, 2, 3] [0, 1, 2, 3].copyWithin(1, 0, null),
[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] [0, 1, 2, 3].copyWithin(1, 0, NaN),
[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] [0, 1, 2, 3].copyWithin(1, 0, false),
[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, 0, 2, 3] [0, 1, 2, 3].copyWithin(1, 0, true),
[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, 0, 1, 3] [0, 1, 2, 3].copyWithin(1, 0, '-2'),
[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, 0, 1, 3] [0, 1, 2, 3].copyWithin(1, 0, -2.5),
[0, 0, 1, 3]
), ),
'float -2.5 value coerced to integer -2' 'float -2.5 value coerced to integer -2'
); );

View File

@ -16,28 +16,32 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(1, undefined), [0, 0, 1, 2] [0, 1, 2, 3].copyWithin(1, undefined),
[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, 0, 1, 2] [0, 1, 2, 3].copyWithin(1, false),
[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, 0, 1, 2] [0, 1, 2, 3].copyWithin(1, NaN),
[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, 0, 1, 2] [0, 1, 2, 3].copyWithin(1, null),
[0, 0, 1, 2]
), ),
'null value coerced to 0' 'null value coerced to 0'
); );
@ -45,7 +49,8 @@ assert(
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, true), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(0, true),
[1, 2, 3, 3]
), ),
'true value coerced to 1' 'true value coerced to 1'
); );
@ -53,21 +58,24 @@ assert(
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, '1'), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(0, '1'),
[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, 0, 1, 2] [0, 1, 2, 3].copyWithin(1, 0.5),
[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), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(0, 1.5),
[1, 2, 3, 3]
), ),
'1.5 float value coerced to integer 1' '1.5 float value coerced to integer 1'
); );

View File

@ -16,28 +16,32 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(undefined, 1), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(undefined, 1),
[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), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(false, 1),
[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), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(NaN, 1),
[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), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(null, 1),
[1, 2, 3, 3]
), ),
'null value coerced to 0' 'null value coerced to 0'
); );
@ -45,7 +49,8 @@ assert(
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(true, 0), [0, 0, 1, 2] [0, 1, 2, 3].copyWithin(true, 0),
[0, 0, 1, 2]
), ),
'true value coerced to 1' 'true value coerced to 1'
); );
@ -53,21 +58,24 @@ assert(
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin('1', 0), [0, 0, 1, 2] [0, 1, 2, 3].copyWithin('1', 0),
[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), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(0.5, 1),
[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, 0, 1, 2] [0, 1, 2, 3].copyWithin(1.5, 0),
[0, 0, 1, 2]
), ),
'1.5 float value coerced to integer 1' '1.5 float value coerced to integer 1'
); );

View File

@ -20,56 +20,64 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, 1, -1), [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]' '[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, 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]' '[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, 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]' '[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), [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]' '[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, 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]' '[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, 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]' '[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, 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]' '[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), [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]' '[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) -> [3, 1, 2, 3, 4]'
); );

View File

@ -20,70 +20,80 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, 1, -10), [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]' '[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] [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]' '[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] [0, 1, 2, 3].copyWithin(0, -2, -10),
[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] [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]' '[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] [0, 1, 2, 3].copyWithin(0, -9, -10),
[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] [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]' '[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] [0, 1, 2, 3].copyWithin(-3, -2, -10),
[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] [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]' '[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] [0, 1, 2, 3].copyWithin(-7, -8, -9),
[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] [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]' '[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) -> [1, 2, 3, 4, 5]'
); );

View File

@ -17,28 +17,32 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, -10), [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]' '[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] [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]' '[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, 0, 1, 2] [0, 1, 2, 3, 4].copyWithin(2, -10),
[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, 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]' '[1, 2, 3, 4, 5].copyWithin(2, -Infinity) -> [1, 2, 1, 2, 3]'
); );
@ -46,14 +50,16 @@ assert(
assert( assert(
compareArray( compareArray(
[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]
), ),
'[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] [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]' '[1, 2, 3, 4, 5].copyWithin(10, -Infinity) -> [1, 2, 3, 4, 5]'
); );
@ -61,14 +67,16 @@ assert(
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(-9, -10), [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]' '[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] [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]' '[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) -> [1, 2, 3, 4, 5]'
); );

View File

@ -17,28 +17,32 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(-10, 0), [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]' '[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] [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]' '[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), [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]' '[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), [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]' '[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) -> [3, 4, 5, 4, 5]'
); );

View File

@ -17,42 +17,48 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, -1), [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]' '[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, 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]' '[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, 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]' '[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, 2] [0, 1, 2, 3].copyWithin(-1, -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, 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]' '[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), [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]' '[0, 1, 2, 3, 4].copyWithin(-5, -2) -> [3, 4, 2, 3, 4]'
); );

View File

@ -17,21 +17,24 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(-1, 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]' '[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, 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]' '[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, 2] [0, 1, 2, 3].copyWithin(-1, 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]'
); );

View File

@ -36,28 +36,32 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, 1, 6), [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]' '[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]'
); );
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, 1, Infinity), [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]' '[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, 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]' '[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, 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]' '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [0, 3, 4, 5, 4, 5]'
); );

View File

@ -30,56 +30,64 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[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]
), ),
'[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] [0, 1, 2, 3, 4, 5].copyWithin(7, 0),
[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] [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]' '[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] [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]' '[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] [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]' '[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] [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]' '[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] [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]' '[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] [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]' '[0, 1, 2, 3, 4, 5].copyWithin(0, 7) => [0, 1, 2, 3, 4, 5]'
); );
@ -87,21 +95,24 @@ assert(
assert( assert(
compareArray( compareArray(
[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]
), ),
'[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] [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]' '[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] [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]' '[0, 1, 2, 3, 4, 5].copyWithin(1, 7) => [0, 1, 2, 3, 4, 5]'
); );
@ -109,28 +120,32 @@ assert(
assert( assert(
compareArray( compareArray(
[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]
), ),
'[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] [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]' '[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] [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]' '[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] [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]' '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) => [0, 1, 2, 3, 4, 5]'
); );

View File

@ -34,24 +34,28 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0), ['a', 'b', 'c', 'd', 'e', 'f'] ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0),
['a', 'b', 'c', 'd', 'e', 'f']
) )
); );
assert( assert(
compareArray( compareArray(
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2), ['c', 'd', 'e', 'f', 'e', 'f'] ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2),
['c', 'd', 'e', 'f', 'e', 'f']
) )
); );
assert( assert(
compareArray( compareArray(
['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0), ['a', 'b', 'c', 'a', 'b', 'c'] ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0),
['a', 'b', 'c', 'a', 'b', 'c']
) )
); );
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3, 4, 5].copyWithin(1, 4), [0, 4, 5, 3, 4, 5] [0, 1, 2, 3, 4, 5].copyWithin(1, 4),
[0, 4, 5, 3, 4, 5]
) )
); );

View File

@ -36,21 +36,24 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, 0, 0), [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]' '[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] [0, 1, 2, 3].copyWithin(0, 0, 2),
[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), [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]' '[0, 1, 2, 3].copyWithin(0, 1, 2) -> [1, 1, 2, 3]'
); );
@ -68,14 +71,16 @@ assert(
*/ */
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(1, 0, 2), [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]' '[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, 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]' '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) -> [0, 3, 4, 3, 4, 5]'
); );

View File

@ -23,3 +23,4 @@ var o1 = {
assert.throws(Test262Error, function() { assert.throws(Test262Error, function() {
[].copyWithin(0, 0, o1); [].copyWithin(0, 0, o1);
}); });

View File

@ -22,3 +22,4 @@ var o1 = {
assert.throws(Test262Error, function() { assert.throws(Test262Error, function() {
[].copyWithin(0, o1); [].copyWithin(0, o1);
}); });

View File

@ -17,14 +17,16 @@ includes: [compareArray.js]
assert( assert(
compareArray( compareArray(
[0, 1, 2, 3].copyWithin(0, 1, undefined), [1, 2, 3, 3] [0, 1, 2, 3].copyWithin(0, 1, undefined),
[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), [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]' '[0, 1, 2, 3].copyWithin(0, 1) -> [1, 2, 3, 3]'
); );

View File

@ -8,7 +8,6 @@ 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;

View File

@ -8,7 +8,6 @@ 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;

View File

@ -8,7 +8,6 @@ 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;

View File

@ -23,10 +23,7 @@ Object.defineProperty(Object.prototype, "length", {
configurable: true configurable: true
}); });
var obj = { var obj = { 0: 9, 1: 8 };
0: 9,
1: 8
};
Object.defineProperty(obj, "length", { Object.defineProperty(obj, "length", {
set: function () { }, set: function () { },
configurable: true configurable: true

View File

@ -16,10 +16,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 11, 1: 12 };
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');

View File

@ -17,9 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { var proto = { length: 3 };
length: 3
};
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;

View File

@ -10,7 +10,6 @@ description: >
---*/ ---*/
var arrProtoLen = 0; var arrProtoLen = 0;
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }

View File

@ -17,9 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { var proto = { length: 2 };
length: 2
};
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;

View File

@ -17,9 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { var proto = { length: 3 };
length: 3
};
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;

View File

@ -14,10 +14,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: undefined };
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');

View File

@ -16,10 +16,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: NaN };
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');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: "2" };
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)');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" };
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');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" };
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)');

View File

@ -14,18 +14,9 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var objOne = { var objOne = { 0: 9, length: "Infinity" };
0: 9, var objTwo = { 0: 9, length: "+Infinity" };
length: "Infinity" var objThree = { 0: 9, 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)');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" };
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)');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" };
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)');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" };
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)');

View File

@ -16,11 +16,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, 1: 8, length: "two" };
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');

View File

@ -17,11 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 11, 1: 9, length: true };
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)');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 };
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)');

View File

@ -14,10 +14,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: 0 };
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');

View File

@ -14,10 +14,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: +0 };
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');

View File

@ -14,10 +14,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: -0 };
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');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: 2 };
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)');

View File

@ -17,12 +17,7 @@ function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = { 0: 12, 1: 11, 2: 9, length: -4294967294 }; //length used to exec while loop is 0
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');

View File

@ -16,10 +16,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: Infinity };
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');

View File

@ -16,10 +16,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 9, length: -Infinity };
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');

View File

@ -9,10 +9,7 @@ description: >
was thrown by step 2 was thrown by step 2
---*/ ---*/
var obj = { var obj = { 0: 11, 1: 12 };
0: 11,
1: 12
};
Object.defineProperty(obj, "length", { Object.defineProperty(obj, "length", {
get: function () { get: function () {

View File

@ -9,10 +9,7 @@ description: >
was thrown by step 3 was thrown by step 3
---*/ ---*/
var obj = { var obj = { 0: 11, 1: 12 };
0: 11,
1: 12
};
Object.defineProperty(obj, "length", { Object.defineProperty(obj, "length", {
get: function () { get: function () {

View File

@ -9,9 +9,7 @@ description: >
passing undefined for callbackfn passing undefined for callbackfn
---*/ ---*/
var obj = { var obj = { 10: 10 };
10: 10
};
var lengthAccessed = false; var lengthAccessed = false;
var loopAccessed = false; var loopAccessed = false;

View File

@ -9,10 +9,7 @@ description: >
visible when an exception occurs visible when an exception occurs
---*/ ---*/
var obj = { var obj = { 0: 11, 1: 12 };
0: 11,
1: 12
};
var accessed = false; var accessed = false;

View File

@ -9,10 +9,7 @@ description: >
visible when an exception occurs visible when an exception occurs
---*/ ---*/
var obj = { var obj = { 0: 11, 1: 12 };
0: 11,
1: 12
};
var accessed = false; var accessed = false;

View File

@ -10,7 +10,6 @@ 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;

View File

@ -10,7 +10,6 @@ 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;

View File

@ -10,7 +10,6 @@ description: >
---*/ ---*/
var res = false; var res = false;
function callbackfn(val, idx, obj) function callbackfn(val, idx, obj)
{ {
return this.res; return this.res;

View File

@ -8,7 +8,6 @@ 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;

View File

@ -8,7 +8,6 @@ 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;

View File

@ -14,11 +14,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 0: 11, 1: 12, length: 0 };
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');

View File

@ -16,11 +16,7 @@ function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var obj = { var obj = { 1: 12, 2: 9, length: 2 };
1: 12,
2: 9,
length: 2
};
Object.defineProperty(obj, "0", { Object.defineProperty(obj, "0", {
get: function () { get: function () {

View File

@ -10,7 +10,6 @@ description: >
---*/ ---*/
var callCnt = 0.; var callCnt = 0.;
function callbackfn(val, Idx, obj) function callbackfn(val, Idx, obj)
{ {
callCnt++; callCnt++;

View File

@ -10,15 +10,11 @@ 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 = { var arr = { 2: 2, length: 20 };
2: 2,
length: 20
};
Object.defineProperty(arr, "0", { Object.defineProperty(arr, "0", {
get: function () { get: function () {

View File

@ -10,7 +10,6 @@ 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;

View File

@ -17,12 +17,7 @@ function callbackfn(val, idx, obj) {
return true; return true;
} }
} }
var arr = { var arr = { 0: 0, 1: 111, 2: 2, length: 10 };
0: 0,
1: 111,
2: 2,
length: 10
};
Object.defineProperty(arr, "0", { Object.defineProperty(arr, "0", {
get: function () { get: function () {

View File

@ -10,7 +10,6 @@ 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