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