mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
Replace runTestCase with assert helpers [test/built-ins/Array/prototype/map]
This commit is contained in:
parent
e2e4fa4c93
commit
976a687b27
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-0-1
|
||||
description: Array.prototype.map must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Array.prototype.map;
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -4,12 +4,6 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-0-2
|
||||
description: Array.prototype.map.length must be 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Array.prototype.map.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.map.length, 1, 'Array.prototype.map.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-11
|
||||
description: Array.prototype.map - applied to Date object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Date;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-12
|
||||
description: Array.prototype.map - applied to RegExp object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof RegExp;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-14
|
||||
description: Array.prototype.map - applied to Error object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Error;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-15
|
||||
description: Array.prototype.map - applied to the Arguments object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return ('[object Arguments]' === Object.prototype.toString.call(obj));
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[1] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-4
|
||||
description: Array.prototype.map - applied to Boolean object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Boolean;
|
||||
}
|
||||
@ -19,6 +17,5 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true && testResult[1] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-6
|
||||
description: Array.prototype.map - applied to Number object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Number;
|
||||
}
|
||||
@ -19,6 +17,5 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true && testResult[1] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
|
@ -4,16 +4,14 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-7
|
||||
description: Array.prototype.map - applied to string primitive
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof String;
|
||||
}
|
||||
|
||||
var testResult = Array.prototype.map.call("abc", callbackfn);
|
||||
|
||||
return testResult[0] === true && testResult[1] === true && testResult[2] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
assert.sameValue(testResult[2], true, 'testResult[2]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-8
|
||||
description: Array.prototype.map - applied to String object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof String;
|
||||
}
|
||||
@ -15,6 +13,6 @@ function testcase() {
|
||||
var obj = new String("abc");
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true && testResult[1] === true && testResult[2] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
assert.sameValue(testResult[2], true, 'testResult[2]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-1-9
|
||||
description: Array.prototype.map - applied to Function object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Function;
|
||||
}
|
||||
@ -20,6 +18,5 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[0] === true && testResult[1] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-1
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object when 'length'
|
||||
is an own data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -23,6 +21,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-10
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object, 'length' is an
|
||||
inherited accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -33,6 +31,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-2-11
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object when 'length'
|
||||
is an own accessor property without a get function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -26,6 +23,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return 0 === testResult.length;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 0, 'testResult.length');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-2-13
|
||||
description: >
|
||||
Array.prototype.map - applied to the Array-like object when
|
||||
'length' is inherited accessor property without a get function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -30,6 +27,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return 0 === testResult.length;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 0, 'testResult.length');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-2-14
|
||||
description: >
|
||||
Array.prototype.map - applied to the Array-like object that
|
||||
'length' property doesn't exist
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -19,6 +16,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return 0 === testResult.length;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 0, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-17
|
||||
description: >
|
||||
Array.prototype.map - applied to Arguments object, which
|
||||
implements its own property get method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,6 +18,4 @@ function testcase() {
|
||||
|
||||
var testResult = func(12, 11);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-19
|
||||
description: >
|
||||
Array.prototype.map - applied to Function object, which implements
|
||||
its own property get method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -23,6 +21,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(fun, callbackfn);
|
||||
|
||||
return 2 === testResult.length;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,15 +6,12 @@ es5id: 15.4.4.19-2-2
|
||||
description: >
|
||||
Array.prototype.map - when 'length' is own data property on an
|
||||
Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
|
||||
var testResult = [12, 11].map(callbackfn);
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-3
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object, 'length' is an
|
||||
own data property that overrides an inherited data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -27,6 +25,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-5
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object, 'length' is an
|
||||
own data property that overrides an inherited accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -37,6 +35,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-6
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object, 'length' is an
|
||||
inherited data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -26,6 +24,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-7
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object, 'length' is an
|
||||
own accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -29,6 +27,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-2-8
|
||||
description: >
|
||||
Array.prototype.map - applied to Array-like object, 'length' is an
|
||||
own accessor property that overrides an inherited data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -34,6 +32,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.map - applied to Array-like object when 'length'
|
||||
is an own accessor property that overrides an inherited accessor
|
||||
property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -42,6 +40,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-1
|
||||
description: Array.prototype.map - value of 'length' is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-10
|
||||
description: Array.prototype.map - value of 'length' is a number (value is NaN)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-11
|
||||
description: >
|
||||
Array.prototype.map - 'length' is a string containing a positive
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-12
|
||||
description: >
|
||||
Array.prototype.map - 'length' is a string containing a negative
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-13
|
||||
description: >
|
||||
Array.prototype.map - value of 'length' is string that is able to
|
||||
convert to number primitive (value is a decimal number)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-15
|
||||
description: >
|
||||
Array.prototype.map - 'length' is a string containing an
|
||||
exponential number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-16
|
||||
description: Array.prototype.map - 'length' is a string containing a hex number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-17
|
||||
description: >
|
||||
Array.prototype.map - when 'length' is a string containing a
|
||||
number with leading zeros
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-3-18
|
||||
description: >
|
||||
Array.prototype.map - value of 'length' is a string that can't
|
||||
convert to a number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -19,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-3-19
|
||||
description: >
|
||||
Array.prototype.map - value of 'length' is an Object which has an
|
||||
own toString method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -28,6 +25,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-2
|
||||
description: >
|
||||
Array.prototype.map on an Array-like object if 'length' is 1
|
||||
(length overridden to true(type conversion))
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 1;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 1, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-20
|
||||
description: >
|
||||
Array.prototype.map - value of 'length' is an Object which has an
|
||||
own valueOf method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -27,6 +25,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Array.prototype.map - 'length' is an object that has an own
|
||||
valueOf method that returns an object and toString method that
|
||||
returns a string
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -36,6 +33,6 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2 && firstStepOccured && secondStepOccured;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
assert(firstStepOccured, 'firstStepOccured !== true');
|
||||
assert(secondStepOccured, 'secondStepOccured !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-3-23
|
||||
description: >
|
||||
Array.prototype.map uses inherited valueOf method when 'length' is
|
||||
an object with an own toString and inherited valueOf methods
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -43,6 +40,6 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2 && valueOfAccessed && !toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
assert.sameValue(toStringAccessed, false, 'toStringAccessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-3-24
|
||||
description: >
|
||||
Array.prototype.map - value of 'length' is a positive non-integer,
|
||||
ensure truncation occurs in the proper direction
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -23,6 +20,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-25
|
||||
description: Array.prototype.map - value of 'length' is a negative non-integer
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -21,6 +18,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-3
|
||||
description: Array.prototype.map - value of 'length' is a number (value is 0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-4
|
||||
description: Array.prototype.map - value of 'length' is a number (value is +0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-3-5
|
||||
description: Array.prototype.map - value of 'length' is a number (value is -0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-6
|
||||
description: >
|
||||
Array.prototype.map - 'length' is a string containing a positive
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 2;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 2, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-7
|
||||
description: >
|
||||
Array.prototype.map - 'length' is a string containing a negative
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-3-9
|
||||
description: >
|
||||
Array.prototype.map - value of 'length' is a number (value is
|
||||
-Infinity)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val < 10;
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr.length === 0;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr.length, 0, 'newArr.length');
|
||||
|
@ -4,16 +4,14 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-4-12
|
||||
description: Array.prototype.map - 'callbackfn' is a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
|
||||
var testResult = [11, 9].map(callbackfn);
|
||||
return testResult.length === 2 && testResult[0] === true && testResult[1] === false;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult.length, 2, 'testResult.length');
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], false, 'testResult[1]');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 15.4.4.19-5-1-s
|
||||
description: Array.prototype.map - thisArg not passed to strict callbackfn
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var innerThisCorrect = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +16,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
[1].map(callbackfn);
|
||||
return innerThisCorrect;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(innerThisCorrect, 'innerThisCorrect !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-10
|
||||
description: Array.prototype.map - Array object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objArray = new Array(2);
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objArray);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-11
|
||||
description: Array.prototype.map - String object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objString = new String();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objString);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-12
|
||||
description: Array.prototype.map - Boolean object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objBoolean = new Boolean();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objBoolean);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-13
|
||||
description: Array.prototype.map - Number object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objNumber = new Number();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objNumber);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-14
|
||||
description: Array.prototype.map - the Math object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === Math;
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, Math);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-15
|
||||
description: Array.prototype.map - Date object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objDate = new Date();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objDate);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-16
|
||||
description: Array.prototype.map - RegExp object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objRegExp = new RegExp();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objRegExp);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-17
|
||||
description: Array.prototype.map - the JSON object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === JSON;
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, JSON);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-18
|
||||
description: Array.prototype.map - Error object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objError = new RangeError();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objError);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-19
|
||||
description: Array.prototype.map - the Arguments object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var arg;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
}(1, 2, 3));
|
||||
|
||||
var testResult = [11].map(callbackfn, arg);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-2
|
||||
description: Array.prototype.map - thisArg is Object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
var o = new Object();
|
||||
o.res = true;
|
||||
@ -18,8 +16,5 @@ function testcase() {
|
||||
|
||||
var srcArr = [1];
|
||||
var resArr = srcArr.map(callbackfn,o);
|
||||
if( resArr[0] === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(resArr[0], true, 'resArr[0]');
|
||||
|
@ -4,18 +4,13 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-21
|
||||
description: Array.prototype.map - the global object can be used as thisArg
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === fnGlobalObject();
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, fnGlobalObject());
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-22
|
||||
description: Array.prototype.map - boolean primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this.valueOf() === false;
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, false);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-23
|
||||
description: Array.prototype.map - number primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this.valueOf() === 101;
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, 101);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-24
|
||||
description: Array.prototype.map - string primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this.valueOf() === "abc";
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, "abc");
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-3
|
||||
description: Array.prototype.map - thisArg is Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
var a = new Array();
|
||||
a.res = true;
|
||||
@ -18,8 +16,5 @@ function testcase() {
|
||||
|
||||
var srcArr = [1];
|
||||
var resArr = srcArr.map(callbackfn,a);
|
||||
if( resArr[0] === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(resArr[0], true, 'resArr[0]');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-5-4
|
||||
description: >
|
||||
Array.prototype.map - thisArg is object from object
|
||||
template(prototype)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -22,8 +20,5 @@ function testcase() {
|
||||
|
||||
var srcArr = [1];
|
||||
var resArr = srcArr.map(callbackfn,f);
|
||||
if( resArr[0] === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(resArr[0], true, 'resArr[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-5
|
||||
description: Array.prototype.map - thisArg is object from object template
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -20,8 +18,5 @@ function testcase() {
|
||||
|
||||
var srcArr = [1];
|
||||
var resArr = srcArr.map(callbackfn,f);
|
||||
if( resArr[0] === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(resArr[0], true, 'resArr[0]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-6
|
||||
description: Array.prototype.map - thisArg is function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -19,8 +17,5 @@ function testcase() {
|
||||
|
||||
var srcArr = [1];
|
||||
var resArr = srcArr.map(callbackfn,foo);
|
||||
if( resArr[0] === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(resArr[0], true, 'resArr[0]');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-7
|
||||
description: Array.prototype.map - built-in functions can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === eval;
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, eval);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-5-9
|
||||
description: Array.prototype.map - Function object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objFunction = function () { };
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var testResult = [11].map(callbackfn, objFunction);
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -6,14 +6,8 @@ es5id: 15.4.4.19-6-1
|
||||
description: >
|
||||
Array.prototype.map - Array.isArray returns true when input
|
||||
argument is the ourput array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var newArr = [11].map(function () { });
|
||||
|
||||
return Array.isArray(newArr);
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.isArray(newArr), 'Array.isArray(newArr) !== true');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-6-2
|
||||
description: Array.prototype.map - the returned array is instanceof Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var newArr = [11].map(function () { });
|
||||
|
||||
return newArr instanceof Array;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newArr instanceof Array, 'newArr instanceof Array !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-1
|
||||
description: >
|
||||
Array.prototype.map doesn't consider new elements added to array
|
||||
after it is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
srcArr[2] = 3;
|
||||
@ -20,8 +17,5 @@ function testcase() {
|
||||
|
||||
var srcArr = [1,2,,4,5];
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
if(resArr.length === 5)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 5, 'resArr.length');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-2
|
||||
description: >
|
||||
Array.prototype.map considers new value of elements in array after
|
||||
it is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
srcArr[4] = -1;
|
||||
@ -22,8 +19,6 @@ function testcase() {
|
||||
|
||||
var srcArr = [1,2,3,4,5];
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
if(resArr.length === 5 && resArr[4] === 0)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 5, 'resArr.length');
|
||||
assert.sameValue(resArr[4], 0, 'resArr[4]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-3
|
||||
description: >
|
||||
Array.prototype.map doesn't visit deleted elements in array after
|
||||
the call
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
delete srcArr[4];
|
||||
@ -23,8 +20,6 @@ function testcase() {
|
||||
|
||||
var srcArr = [1,2,3,4,5];
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
if(resArr.length === 5 && resArr[4] === undefined)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 5, 'resArr.length');
|
||||
assert.sameValue(resArr[4], undefined, 'resArr[4]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-4
|
||||
description: >
|
||||
Array.prototype.map doesn't visit deleted elements when
|
||||
Array.length is decreased
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var callCnt = 0;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -21,8 +18,7 @@ function testcase() {
|
||||
|
||||
var srcArr = [1,2,3,4,5];
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
if(resArr.length === 5 && callCnt === 2 && resArr[2] === undefined)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 5, 'resArr.length');
|
||||
assert.sameValue(callCnt, 2, 'callCnt');
|
||||
assert.sameValue(resArr[2], undefined, 'resArr[2]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-5
|
||||
description: >
|
||||
Array.prototype.map doesn't consider newly added elements in
|
||||
sparse array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var callCnt = 0;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -23,8 +20,6 @@ function testcase() {
|
||||
srcArr[1] = 1;
|
||||
srcArr[2] = 2;
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
if( resArr.length === 10 && callCnt === 2)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 10, 'resArr.length');
|
||||
assert.sameValue(callCnt, 2, 'callCnt');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-6
|
||||
description: >
|
||||
Array.prototype.map visits deleted element in array after the call
|
||||
when same index is also present in prototype
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
delete srcArr[4];
|
||||
@ -25,8 +22,6 @@ function testcase() {
|
||||
var srcArr = [1,2,3,4,5];
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
delete Array.prototype[4];
|
||||
if(resArr.length === 5 && resArr[4] === 1)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 5, 'resArr.length');
|
||||
assert.sameValue(resArr[4], 1, 'resArr[4]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-8-7
|
||||
description: Array.prototype.map successful to delete the object in callbackfn
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = {};
|
||||
obj.srcArr = [1, 2, 3, 4, 5];
|
||||
|
||||
@ -20,6 +18,6 @@ function testcase() {
|
||||
}
|
||||
|
||||
var resArr = obj.srcArr.map(callbackfn);
|
||||
return resArr.toString() === "1,1,1,1,1" && !obj.hasOwnProperty("arr");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.toString(), "1,1,1,1,1", 'resArr.toString()');
|
||||
assert.sameValue(obj.hasOwnProperty("arr"), false, 'obj.hasOwnProperty("arr")');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-8
|
||||
description: >
|
||||
Array.prototype.map - no observable effects occur if length is 0
|
||||
on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -21,6 +18,5 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult.length === 0 && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 0, 'testResult.length');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-9
|
||||
description: >
|
||||
Array.prototype.map - modifications to length don't change number
|
||||
of iterations on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var called = 0;
|
||||
function callbackfn(val, idx, obj) {
|
||||
called += 1;
|
||||
@ -28,6 +26,6 @@ function testcase() {
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
|
||||
return testResult.length === 3 && called === 2 && typeof testResult[2] === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult.length, 3, 'testResult.length');
|
||||
assert.sameValue(called, 2, 'called');
|
||||
assert.sameValue(typeof testResult[2], "undefined", 'typeof testResult[2]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-b-1
|
||||
description: >
|
||||
Array.prototype.map - callbackfn not called for indexes never been
|
||||
assigned values
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var callCnt = 0;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -21,7 +18,6 @@ function testcase() {
|
||||
var srcArr = new Array(10);
|
||||
srcArr[1] = undefined; //explicitly assigning a value
|
||||
var resArr = srcArr.map(callbackfn);
|
||||
if( resArr.length === 10 && callCnt === 1)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(resArr.length, 10, 'resArr.length');
|
||||
assert.sameValue(callCnt, 1, 'callCnt');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-b-14
|
||||
description: >
|
||||
Array.prototype.map - decreasing length of array causes index
|
||||
property not to be visited
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return idx === 3 && typeof val === "undefined";
|
||||
}
|
||||
@ -26,6 +23,5 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
return typeof testResult[3] === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof testResult[3], "undefined", 'typeof testResult[3]');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.map - decreasing length of array does not delete
|
||||
non-configurable properties
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 2 && val === "unconfigurable") {
|
||||
return false;
|
||||
@ -37,6 +35,6 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
return testResult.length === 3 && testResult[2] === false;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult.length, 3, 'testResult.length');
|
||||
assert.sameValue(testResult[2], false, 'testResult[2]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-8-b-2
|
||||
description: Array.prototype.map - added properties in step 2 are visible here
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 2 && val === "length") {
|
||||
return false;
|
||||
@ -27,6 +25,5 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
return testResult[2] === false;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[2], false, 'testResult[2]');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.19-8-b-3
|
||||
description: Array.prototype.map - deleted properties in step 2 are visible here
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 2) {
|
||||
return false;
|
||||
@ -26,6 +24,5 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
return typeof testResult[2] === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof testResult[2], "undefined", 'typeof testResult[2]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-b-4
|
||||
description: >
|
||||
Array.prototype.map - properties added into own object after
|
||||
current position are visited on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 1 && val === 1) {
|
||||
return false;
|
||||
@ -35,6 +32,6 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
return testResult[0] === true && testResult[1] === false;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], false, 'testResult[1]');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-5
|
||||
description: >
|
||||
Array.prototype.map - properties added into own object after
|
||||
current position are visited on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 1 && val === 1) {
|
||||
return false;
|
||||
@ -34,6 +32,6 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
return testResult[0] === true && testResult[1] === false;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(testResult[1], false, 'testResult[1]');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-8
|
||||
description: >
|
||||
Array.prototype.map - deleting own property causes index property
|
||||
not to be visited on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 1) {
|
||||
return false;
|
||||
@ -35,6 +33,6 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
return testResult[0] === true && typeof testResult[1] === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-b-9
|
||||
description: >
|
||||
Array.prototype.map - deleting own property causes index property
|
||||
not to be visited on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 1) {
|
||||
return false;
|
||||
@ -36,6 +33,6 @@ function testcase() {
|
||||
});
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
return testResult[0] === true && typeof testResult[1] === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-1
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is own data property
|
||||
on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = {};
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -24,6 +21,4 @@ function testcase() {
|
||||
|
||||
var newArr = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return newArr[5] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr[5], true, 'newArr[5]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-10
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is own accessor
|
||||
property on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = "abc";
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -31,6 +28,4 @@ function testcase() {
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Array.prototype.map - element to be retrieved is own accessor
|
||||
property that overrides an inherited data property on an
|
||||
Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = "abc";
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -37,6 +34,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Array.prototype.map - element to be retrieved is own accessor
|
||||
property that overrides an inherited accessor property on an
|
||||
Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = "abc";
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -44,6 +41,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-15
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is inherited
|
||||
accessor property on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = "abc";
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -36,6 +33,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-17
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is own accessor
|
||||
property without a get function on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 1) {
|
||||
return typeof val === "undefined";
|
||||
@ -27,6 +24,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(obj, callbackfn);
|
||||
|
||||
return testResult[1] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-18
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is own accessor
|
||||
property without a get function on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 1) {
|
||||
return typeof val === "undefined";
|
||||
@ -27,6 +24,4 @@ function testcase() {
|
||||
|
||||
var testResult = arr.map(callbackfn);
|
||||
|
||||
return testResult[1] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[1], true, 'testResult[1]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-2
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is own data property
|
||||
on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = {};
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -24,6 +21,4 @@ function testcase() {
|
||||
|
||||
var newArr = arr.map(callbackfn);
|
||||
|
||||
return newArr[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newArr[0], true, 'newArr[0]');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Array.prototype.map - element to be retrieved is own accessor
|
||||
property without a get function that overrides an inherited
|
||||
accessor property on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 0) {
|
||||
return typeof val === "undefined";
|
||||
@ -41,6 +38,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-21
|
||||
description: >
|
||||
Array.prototype.map - element to be retrieved is inherited
|
||||
accessor property without a get function on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 0) {
|
||||
return typeof val === "undefined";
|
||||
@ -31,6 +28,4 @@ function testcase() {
|
||||
|
||||
var testResult = Array.prototype.map.call(child, callbackfn);
|
||||
|
||||
return testResult[0] === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(testResult[0], true, 'testResult[0]');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user