mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 08:24:23 +02:00
Replace runTestCase with assert helpers [test/built-ins/Array/prototype/some]
This commit is contained in:
parent
a87aedd8a5
commit
659aa4c0f8
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-0-1
|
||||
description: Array.prototype.some must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Array.prototype.some;
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -4,12 +4,6 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-0-2
|
||||
description: Array.prototype.some.length must be 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Array.prototype.some.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.length, 1, 'Array.prototype.some.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-11
|
||||
description: Array.prototype.some applied to Date object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Date;
|
||||
}
|
||||
@ -17,6 +15,4 @@ function testcase() {
|
||||
obj[0] = 11;
|
||||
obj[1] = 9;
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-12
|
||||
description: Array.prototype.some applied to RegExp object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof RegExp;
|
||||
}
|
||||
@ -17,6 +15,4 @@ function testcase() {
|
||||
obj[0] = 11;
|
||||
obj[1] = 9;
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-14
|
||||
description: Array.prototype.some applied to Error object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Error;
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
obj.length = 1;
|
||||
obj[0] = 1;
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-15
|
||||
description: Array.prototype.some applied to the Arguments object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return '[object Arguments]' === Object.prototype.toString.call(obj);
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
return arguments;
|
||||
}("a", "b"));
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-4
|
||||
description: Array.prototype.some applied to Boolean object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Boolean;
|
||||
}
|
||||
@ -17,6 +15,4 @@ function testcase() {
|
||||
obj[0] = 11;
|
||||
obj[1] = 9;
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-6
|
||||
description: Array.prototype.some applied to Number object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Number;
|
||||
}
|
||||
@ -17,6 +15,4 @@ function testcase() {
|
||||
obj[0] = 11;
|
||||
obj[1] = 9;
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,14 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-7
|
||||
description: Array.prototype.some applied to applied to string primitive
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof String;
|
||||
}
|
||||
|
||||
return Array.prototype.some.call("hello\nw_orld\\!", callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call("hello\nw_orld\\!", callbackfn), 'Array.prototype.some.call("hello\nw_orld\\!", callbackfn) !== true');
|
||||
|
@ -4,15 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-8
|
||||
description: Array.prototype.some applied to String object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof String;
|
||||
}
|
||||
|
||||
var obj = new String("hello\nw_orld\\!");
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-1-9
|
||||
description: Array.prototype.some applied to Function object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return obj instanceof Function;
|
||||
}
|
||||
@ -17,6 +15,5 @@ function testcase() {
|
||||
};
|
||||
obj[0] = 11;
|
||||
obj[1] = 9;
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-2-1
|
||||
description: >
|
||||
Array.prototype.some - 'length' is own data property on an
|
||||
Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -26,7 +23,5 @@ function testcase() {
|
||||
length: 2
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-10
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an inherited accessor property
|
||||
on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -35,7 +33,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn1) &&
|
||||
!Array.prototype.some.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-2-11
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an own accessor property
|
||||
without a get function on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -27,6 +24,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-2-13
|
||||
description: >
|
||||
Array.prototype.some - 'length' is inherited accessor property
|
||||
without a get function on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -31,6 +28,5 @@ function testcase() {
|
||||
child[0] = 11;
|
||||
child[1] = 12;
|
||||
|
||||
return !Array.prototype.some.call(child, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn), false, 'Array.prototype.some.call(child, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-2-14
|
||||
description: >
|
||||
Array.prototype.some - 'length' property doesn't exist on an
|
||||
Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 12 };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-17
|
||||
description: >
|
||||
Array.prototype.some applied to the Arguments object which
|
||||
implements its own property get method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -24,6 +22,4 @@ function testcase() {
|
||||
!Array.prototype.some.call(arguments, callbackfn2);
|
||||
};
|
||||
|
||||
return func(9, 11);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(func(9, 11), 'func(9, 11) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-19
|
||||
description: >
|
||||
Array.prototype.some applied to Function object which implements
|
||||
its own property get method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -25,7 +23,5 @@ function testcase() {
|
||||
fun[1] = 11;
|
||||
fun[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(fun, callbackfn1) &&
|
||||
!Array.prototype.some.call(fun, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(fun, callbackfn1), 'Array.prototype.some.call(fun, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(fun, callbackfn2), false, 'Array.prototype.some.call(fun, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-3
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an own data property that
|
||||
overrides an inherited data property on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -29,7 +27,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn1) &&
|
||||
!Array.prototype.some.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-5
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an own data property that
|
||||
overrides an inherited accessor property on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -40,7 +38,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn1) &&
|
||||
!Array.prototype.some.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-6
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an inherited data property on
|
||||
an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -28,7 +26,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn1) &&
|
||||
!Array.prototype.some.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-7
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an own accessor property on an
|
||||
Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -31,7 +29,5 @@ function testcase() {
|
||||
obj[1] = 11;
|
||||
obj[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-8
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an own accessor property that
|
||||
overrides an inherited data property on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -36,7 +34,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn1) &&
|
||||
!Array.prototype.some.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-9
|
||||
description: >
|
||||
Array.prototype.some - 'length' is an own accessor property that
|
||||
overrides an inherited accessor property on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -43,7 +41,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 12;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn1) &&
|
||||
!Array.prototype.some.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn1), 'Array.prototype.some.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(child, callbackfn2), false, 'Array.prototype.some.call(child, callbackfn2)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-1
|
||||
description: Array.prototype.some - value of 'length' is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: undefined };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-10
|
||||
description: Array.prototype.some - value of 'length' is a number (value is NaN)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: NaN };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-11
|
||||
description: >
|
||||
Array.prototype.some - 'length' is a string containing a positive
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: "2" };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-12
|
||||
description: >
|
||||
Array.prototype.some - 'length' is a string containing a negative
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: "-4294967294" };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn1), false, 'Array.prototype.some.call(obj, callbackfn1)');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-13
|
||||
description: >
|
||||
Array.prototype.some - 'length' is a string containing a decimal
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: "2.5" };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-14
|
||||
description: Array.prototype.some - 'length' is a string containing +/-Infinity
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,8 +17,7 @@ function testcase() {
|
||||
var objTwo = { 0: 11, length: "+Infinity" };
|
||||
var objThree = { 0: 11, length: "-Infinity" };
|
||||
|
||||
return Array.prototype.some.call(objOne, callbackfn) &&
|
||||
Array.prototype.some.call(objTwo, callbackfn) &&
|
||||
!Array.prototype.some.call(objThree, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(objOne, callbackfn), 'Array.prototype.some.call(objOne, callbackfn) !== true');
|
||||
assert(Array.prototype.some.call(objTwo, callbackfn), 'Array.prototype.some.call(objTwo, callbackfn) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(objThree, callbackfn), false, 'Array.prototype.some.call(objThree, callbackfn)');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-15
|
||||
description: >
|
||||
Array.prototype.some - 'length' is a string containing an
|
||||
exponential number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: "2E0" };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-16
|
||||
description: Array.prototype.some - 'length' is a string containing a hex number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -18,7 +16,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: "0x0002" };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-17
|
||||
description: >
|
||||
Array.prototype.some - 'length' is a string containing a number
|
||||
with leading zeros
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: "0002.00" };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-3-18
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is a string that can't
|
||||
convert to a number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 21, length: "two" };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-19
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is an Object which has an
|
||||
own toString method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -32,7 +30,6 @@ function testcase() {
|
||||
}
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2) && toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
assert(toStringAccessed, 'toStringAccessed !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-2
|
||||
description: >
|
||||
Array.prototype.some on an Array-like object if 'length' is 1
|
||||
(length overridden to true(type conversion))
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 12, length: true };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-20
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is an Object which has an
|
||||
own valueOf method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -32,7 +30,6 @@ function testcase() {
|
||||
}
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2) && valueOfAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.some - '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 callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -38,8 +36,7 @@ function testcase() {
|
||||
}
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2) &&
|
||||
valueOfAccessed && toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
assert(toStringAccessed, 'toStringAccessed !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-23
|
||||
description: >
|
||||
Array.prototype.some uses inherited valueOf method when 'length'
|
||||
is an object with an own toString and inherited valueOf methods
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -45,8 +43,7 @@ function testcase() {
|
||||
length: child
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2) &&
|
||||
valueOfAccessed && !toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
assert.sameValue(toStringAccessed, false, 'toStringAccessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-24
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is a positive
|
||||
non-integer, ensure truncation occurs in the proper direction
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -25,7 +23,5 @@ function testcase() {
|
||||
length: 11.5
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-25
|
||||
description: Array.prototype.some - value of 'length' is a negative non-integer
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -23,7 +21,5 @@ function testcase() {
|
||||
length: -4294967294.5
|
||||
};
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn1), false, 'Array.prototype.some.call(obj, callbackfn1)');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-28
|
||||
description: Array.prototype.some - value of 'length' is boundary value (2^32)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -21,6 +18,5 @@ function testcase() {
|
||||
length: 4294967296
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-29
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is boundary value (2^32 +
|
||||
1)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -24,7 +22,5 @@ function testcase() {
|
||||
length: 4294967297
|
||||
};
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert(Array.prototype.some.call(obj, callbackfn2), 'Array.prototype.some.call(obj, callbackfn2) !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-3
|
||||
description: Array.prototype.some - value of 'length' is a number (value is 0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: 0 };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-4
|
||||
description: Array.prototype.some - value of 'length' is a number (value is +0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: +0 };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-3-5
|
||||
description: Array.prototype.some - value of 'length' is a number (value is -0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: -0 };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-6
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is a number (value is
|
||||
positive)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: 2 };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn1), 'Array.prototype.some.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-3-7
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is a number (value is
|
||||
negative)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 11, 2: 12, length: -4294967294 };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn1) &&
|
||||
!Array.prototype.some.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn1), false, 'Array.prototype.some.call(obj, callbackfn1)');
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn2), false, 'Array.prototype.some.call(obj, callbackfn2)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-3-8
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is a number (value is
|
||||
Infinity)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: Infinity };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-3-9
|
||||
description: >
|
||||
Array.prototype.some - value of 'length' is a number (value is
|
||||
-Infinity)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, length: -Infinity };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-4-12
|
||||
description: Array.prototype.some - 'callbackfn' is a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
|
||||
return [9, 11].some(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([9, 11].some(callbackfn), '[9, 11].some(callbackfn) !== true');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 15.4.4.17-5-1-s
|
||||
description: Array.prototype.some - 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].some(callbackfn);
|
||||
return innerThisCorrect;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(innerThisCorrect, 'innerThisCorrect !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-10
|
||||
description: Array.prototype.some - Array Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objArray = [];
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objArray;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objArray);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objArray), '[11].some(callbackfn, objArray) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-11
|
||||
description: Array.prototype.some - String object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objString = new String();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objString;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objString);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objString), '[11].some(callbackfn, objString) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-12
|
||||
description: Array.prototype.some - Boolean object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objBoolean = new Boolean();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objBoolean;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objBoolean);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objBoolean), '[11].some(callbackfn, objBoolean) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-13
|
||||
description: Array.prototype.some - Number object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objNumber = new Number();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objNumber;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objNumber);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objNumber), '[11].some(callbackfn, objNumber) !== true');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-14
|
||||
description: Array.prototype.some - the Math object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === Math;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, Math);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, Math), '[11].some(callbackfn, Math) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-15
|
||||
description: Array.prototype.some - Date object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objDate = new Date();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objDate;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objDate);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objDate), '[11].some(callbackfn, objDate) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-16
|
||||
description: Array.prototype.some - RegExp object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objRegExp = new RegExp();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objRegExp;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objRegExp);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objRegExp), '[11].some(callbackfn, objRegExp) !== true');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-17
|
||||
description: Array.prototype.some - the JSON object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === JSON;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, JSON);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, JSON), '[11].some(callbackfn, JSON) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-18
|
||||
description: Array.prototype.some - Error object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objError = new RangeError();
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objError;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objError);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objError), '[11].some(callbackfn, objError) !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-19
|
||||
description: Array.prototype.some - the Arguments object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var arg;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -19,6 +16,4 @@ function testcase() {
|
||||
arg = arguments;
|
||||
}(1, 2, 3));
|
||||
|
||||
return [11].some(callbackfn, arg);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, arg), '[11].some(callbackfn, arg) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-2
|
||||
description: Array.prototype.some - thisArg is Object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
var o = new Object();
|
||||
o.res = true;
|
||||
@ -17,8 +15,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var arr = [1];
|
||||
if(arr.some(callbackfn, o) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn, o), true, 'arr.some(callbackfn, o)');
|
||||
|
@ -4,18 +4,11 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-21
|
||||
description: Array.prototype.some - 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();
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, fnGlobalObject());
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, fnGlobalObject()), '[11].some(callbackfn, fnGlobalObject()) !== true');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-22
|
||||
description: Array.prototype.some - boolean primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this.valueOf() === false;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, false);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, false), '[11].some(callbackfn, false) !== true');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-23
|
||||
description: Array.prototype.some - number primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this.valueOf() === 101;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, 101);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, 101), '[11].some(callbackfn, 101) !== true');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-24
|
||||
description: Array.prototype.some - string primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this.valueOf() === "abc";
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, "abc");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, "abc"), '[11].some(callbackfn, "abc") !== true');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 15.4.4.17-5-25
|
||||
description: Array.prototype.some - thisArg not passed
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function innerObj() {
|
||||
this._15_4_4_17_5_25 = true;
|
||||
var _15_4_4_17_5_25 = false;
|
||||
@ -19,6 +17,5 @@ function testcase() {
|
||||
var arr = [1];
|
||||
this.retVal = !arr.some(callbackfn);
|
||||
}
|
||||
return new innerObj().retVal;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(new innerObj().retVal, 'new innerObj().retVal !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-3
|
||||
description: Array.prototype.some - thisArg is Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
var a = new Array();
|
||||
a.res = true;
|
||||
@ -18,8 +16,4 @@ function testcase() {
|
||||
|
||||
var arr = [1];
|
||||
|
||||
if(arr.some(callbackfn, a) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn, a), true, 'arr.some(callbackfn, a)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-5-4
|
||||
description: >
|
||||
Array.prototype.some - thisArg is object from object
|
||||
template(prototype)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -21,8 +19,4 @@ function testcase() {
|
||||
var f = new foo();
|
||||
var arr = [1];
|
||||
|
||||
if(arr.some(callbackfn,f) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn,f), true, 'arr.some(callbackfn,f)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-5
|
||||
description: Array.prototype.some - thisArg is object from object template
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -19,8 +17,4 @@ function testcase() {
|
||||
f.res = true;
|
||||
var arr = [1];
|
||||
|
||||
if(arr.some(callbackfn,f) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn,f), true, 'arr.some(callbackfn,f)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-6
|
||||
description: Array.prototype.some - thisArg is function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -18,8 +16,4 @@ function testcase() {
|
||||
foo.res = true;
|
||||
var arr = [1];
|
||||
|
||||
if(arr.some(callbackfn,foo) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn,foo), true, 'arr.some(callbackfn,foo)');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-7
|
||||
description: Array.prototype.some - built-in functions can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === eval;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, eval);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, eval), '[11].some(callbackfn, eval) !== true');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-5-9
|
||||
description: Array.prototype.some - Function Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var objFunction = function () { };
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return this === objFunction;
|
||||
}
|
||||
|
||||
return [11].some(callbackfn, objFunction);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].some(callbackfn, objFunction), '[11].some(callbackfn, objFunction) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-1
|
||||
description: >
|
||||
Array.prototype.some considers new elements added to array after
|
||||
it is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var calledForThree = false;
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
@ -24,6 +22,5 @@ function testcase() {
|
||||
var arr = [1,2,,4,5];
|
||||
|
||||
var val = arr.some(callbackfn);
|
||||
return calledForThree;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(calledForThree, 'calledForThree !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-2
|
||||
description: >
|
||||
Array.prototype.some considers new value of elements in array
|
||||
after it is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
arr[4] = 6;
|
||||
@ -22,8 +19,5 @@ function testcase() {
|
||||
|
||||
var arr = [1,2,3,4,5];
|
||||
|
||||
if(arr.some(callbackfn) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.some(callbackfn), true, 'arr.some(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-3
|
||||
description: >
|
||||
Array.prototype.some doesn't visit deleted elements in array after
|
||||
it is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
delete arr[2];
|
||||
@ -22,8 +19,5 @@ function testcase() {
|
||||
|
||||
var arr = [1,2,3,4,5];
|
||||
|
||||
if(arr.some(callbackfn) === false)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-4
|
||||
description: >
|
||||
Array.prototype.some doesn't visit deleted elements when
|
||||
Array.length is decreased
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
arr.length = 3;
|
||||
@ -22,7 +19,5 @@ function testcase() {
|
||||
|
||||
var arr = [1,2,3,4,6];
|
||||
|
||||
if(arr.some(callbackfn) === false)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-5
|
||||
description: >
|
||||
Array.prototype.some doesn't consider newly added elements in
|
||||
sparse array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
arr[1000] = 5;
|
||||
@ -24,8 +21,5 @@ function testcase() {
|
||||
arr[1] = 1;
|
||||
arr[2] = 2;
|
||||
|
||||
if(arr.some(callbackfn) === false)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-6
|
||||
description: >
|
||||
Array.prototype.some 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 arr[4];
|
||||
@ -26,8 +23,5 @@ function testcase() {
|
||||
|
||||
var res = arr.some(callbackfn) ;
|
||||
delete Array.prototype[4];
|
||||
if(res === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(res, true, 'res');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-7-8
|
||||
description: Array.prototype.some - no observable effects occur if length is 0
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 12, length: 0 };
|
||||
|
||||
return !Array.prototype.some.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-9
|
||||
description: >
|
||||
Array.prototype.some - modifications to length don't change number
|
||||
of iterations
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var called = 0;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -28,6 +25,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn) && called === 3;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(called, 3, 'called');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-b-1
|
||||
description: >
|
||||
Array.prototype.some - callbackfn not called for indexes never
|
||||
been assigned values
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var callCnt = 0;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -21,8 +18,5 @@ function testcase() {
|
||||
var arr = new Array(10);
|
||||
arr[1] = undefined;
|
||||
arr.some(callbackfn);
|
||||
if(callCnt === 1)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(callCnt, 1, 'callCnt');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-14
|
||||
description: >
|
||||
Array.prototype.some - decreasing length of array causes index
|
||||
property not to be visited
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -25,6 +23,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !arr.some(callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.some - 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 true;
|
||||
@ -36,6 +34,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return arr.some(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.17-7-b-2
|
||||
description: Array.prototype.some - added properties in step 2 are visible here
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 2 && val === "length") {
|
||||
return true;
|
||||
@ -26,6 +24,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.some.call(arr, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-3
|
||||
description: >
|
||||
Array.prototype.some - deleted properties in step 2 are visible
|
||||
here
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -25,6 +23,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !Array.prototype.some.call(arr, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-b-4
|
||||
description: >
|
||||
Array.prototype.some - 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 true;
|
||||
@ -34,6 +31,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.some.call(arr, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-5
|
||||
description: >
|
||||
Array.prototype.some - 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 true;
|
||||
@ -33,6 +31,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return arr.some(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-8
|
||||
description: >
|
||||
Array.prototype.some - deleting own property causes index property
|
||||
not to be visited on an Array-like object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -32,6 +30,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !Array.prototype.some.call(arr, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-9
|
||||
description: >
|
||||
Array.prototype.some - deleting own property causes index property
|
||||
not to be visited on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -32,6 +30,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !arr.some(callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-1
|
||||
description: >
|
||||
Array.prototype.some - 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) {
|
||||
@ -22,6 +19,4 @@ function testcase() {
|
||||
|
||||
var obj = { 5: kValue, length: 100 };
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-10
|
||||
description: >
|
||||
Array.prototype.some - element to be retrieved is own accessor
|
||||
property on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = "abc";
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -29,6 +26,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return arr.some(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Array.prototype.some - 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) {
|
||||
@ -36,6 +33,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Array.prototype.some - 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() {
|
||||
});
|
||||
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-15
|
||||
description: >
|
||||
Array.prototype.some - 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) {
|
||||
@ -35,6 +32,4 @@ function testcase() {
|
||||
var child = new Con();
|
||||
child.length = 20;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-17
|
||||
description: >
|
||||
Array.prototype.some - 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";
|
||||
@ -24,6 +21,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.some.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-18
|
||||
description: >
|
||||
Array.prototype.some - 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 === 0) {
|
||||
return typeof val === "undefined";
|
||||
@ -25,6 +22,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return arr.some(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-2
|
||||
description: >
|
||||
Array.prototype.some - element to be retrieved is own data
|
||||
property on an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var kValue = {};
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,4 @@ function testcase() {
|
||||
return false;
|
||||
}
|
||||
|
||||
return [kValue].some(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-21
|
||||
description: >
|
||||
Array.prototype.some - 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 === 1) {
|
||||
return typeof val === "undefined";
|
||||
@ -30,6 +27,4 @@ function testcase() {
|
||||
var child = new Con();
|
||||
child.length = 2;
|
||||
|
||||
return Array.prototype.some.call(child, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.some.call(child, callbackfn), 'Array.prototype.some.call(child, callbackfn) !== true');
|
||||
|
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