mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #409 from anba/remove-runTestCase-Array
Replace runTestCase in built-ins/Array
This commit is contained in:
commit
2663137ef8
@ -4,14 +4,9 @@
|
||||
/*---
|
||||
es5id: 15.4.5-1
|
||||
description: Array instances have [[Class]] set to 'Array'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a = [];
|
||||
var s = Object.prototype.toString.call(a);
|
||||
if (s === '[object Array]') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(s, '[object Array]', 's');
|
||||
|
@ -4,12 +4,9 @@
|
||||
/*---
|
||||
es5id: 15.4.5.1-3.d-3
|
||||
description: Set array length property to max value 4294967295 (2**32-1,)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a =[];
|
||||
a.length = 4294967295 ;
|
||||
return a.length===4294967295 ;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(a.length, 4294967295, 'a.length');
|
||||
|
@ -6,12 +6,9 @@ es5id: 15.4.5.1-5-1
|
||||
description: >
|
||||
Defining a property named 4294967295 (2**32-1)(not an array
|
||||
element)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a =[];
|
||||
a[4294967295] = "not an array element" ;
|
||||
return a[4294967295] === "not an array element";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(a[4294967295], "not an array element", 'a[4294967295]');
|
||||
|
@ -6,12 +6,9 @@ es5id: 15.4.5.1-5-2
|
||||
description: >
|
||||
Defining a property named 4294967295 (2**32-1) doesn't change
|
||||
length of the array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a =[0,1,2];
|
||||
a[4294967295] = "not an array element" ;
|
||||
return a.length===3;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(a.length, 3, 'a.length');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-0-1
|
||||
description: Array.isArray must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Array.isArray;
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -4,12 +4,6 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-0-2
|
||||
description: Array.isArray must exist as a function taking 1 parameter
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Array.isArray.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.isArray.length, 1, 'Array.isArray.length');
|
||||
|
@ -4,14 +4,9 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-0-3
|
||||
description: Array.isArray return true if its argument is an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a = [];
|
||||
var b = Array.isArray(a);
|
||||
if (b === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(b, true, 'b');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-0-4
|
||||
description: Array.isArray return false if its argument is not an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var b_num = Array.isArray(42);
|
||||
var b_undef = Array.isArray(undefined);
|
||||
var b_bool = Array.isArray(true);
|
||||
@ -15,13 +13,10 @@ function testcase() {
|
||||
var b_obj = Array.isArray({});
|
||||
var b_null = Array.isArray(null);
|
||||
|
||||
if (b_num === false &&
|
||||
b_undef === false &&
|
||||
b_bool === false &&
|
||||
b_str === false &&
|
||||
b_obj === false &&
|
||||
b_null === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(b_num, false, 'b_num');
|
||||
assert.sameValue(b_undef, false, 'b_undef');
|
||||
assert.sameValue(b_bool, false, 'b_bool');
|
||||
assert.sameValue(b_str, false, 'b_str');
|
||||
assert.sameValue(b_obj, false, 'b_obj');
|
||||
assert.sameValue(b_null, false, 'b_null');
|
||||
|
@ -6,13 +6,8 @@ es5id: 15.4.3.2-0-5
|
||||
description: >
|
||||
Array.isArray return true if its argument is an Array
|
||||
(Array.prototype)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var b = Array.isArray(Array.prototype);
|
||||
if (b === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(b, true, 'b');
|
||||
|
@ -4,14 +4,9 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-0-6
|
||||
description: Array.isArray return true if its argument is an Array (new Array())
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var a = new Array(10);
|
||||
var b = Array.isArray(a);
|
||||
if (b === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(b, true, 'b');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-0-7
|
||||
description: Array.isArray returns false if its argument is not an Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = new Object();
|
||||
o[12] = 13;
|
||||
var b = Array.isArray(o);
|
||||
if (b === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(b, false, 'b');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-1-13
|
||||
description: Array.isArray applied to Arguments object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var arg;
|
||||
|
||||
(function fun() {
|
||||
arg = arguments;
|
||||
}(1, 2, 3));
|
||||
|
||||
return !Array.isArray(arg);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.isArray(arg), false, 'Array.isArray(arg)');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.3.2-2-1
|
||||
description: Array.isArray applied to an object with an array as the prototype
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var proto = [];
|
||||
var Con = function () { };
|
||||
Con.prototype = proto;
|
||||
|
||||
var child = new Con();
|
||||
return !Array.isArray(child);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)');
|
||||
|
@ -6,17 +6,12 @@ es5id: 15.4.3.2-2-2
|
||||
description: >
|
||||
Array.isArray applied to an object with Array.prototype as the
|
||||
prototype
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var proto = Array.prototype;
|
||||
var Con = function () { };
|
||||
Con.prototype = proto;
|
||||
|
||||
var child = new Con();
|
||||
|
||||
return !Array.isArray(child);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-0-1
|
||||
description: Array.prototype.every must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Array.prototype.every;
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -4,12 +4,6 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-0-2
|
||||
description: Array.prototype.every.length must be 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Array.prototype.every.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.length, 1, 'Array.prototype.every.length');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-11
|
||||
description: Array.prototype.every applied to Date object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return !(obj instanceof Date);
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
obj.length = 1;
|
||||
obj[0] = 1;
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-12
|
||||
description: Array.prototype.every applied to RegExp object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return !(obj instanceof RegExp);
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
obj.length = 1;
|
||||
obj[0] = 1;
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-14
|
||||
description: Array.prototype.every applied to Error object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return !(obj instanceof Error);
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
obj.length = 1;
|
||||
obj[0] = 1;
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-15
|
||||
description: Array.prototype.every applied to the Arguments object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return ('[object Arguments]' !== Object.prototype.toString.call(obj));
|
||||
}
|
||||
@ -16,6 +14,4 @@ function testcase() {
|
||||
return arguments;
|
||||
}("a", "b"));
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-4
|
||||
description: Array.prototype.every applied to Boolean object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -18,6 +16,6 @@ function testcase() {
|
||||
obj.length = 2;
|
||||
obj[0] = 11;
|
||||
obj[1] = 12;
|
||||
return Array.prototype.every.call(obj, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-6
|
||||
description: Array.prototype.every applied to Number object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -18,6 +16,6 @@ function testcase() {
|
||||
obj.length = 2;
|
||||
obj[0] = 11;
|
||||
obj[1] = 12;
|
||||
return Array.prototype.every.call(obj, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,14 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-7
|
||||
description: Array.prototype.every applied to string primitive
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return !(obj instanceof String);
|
||||
}
|
||||
|
||||
return !Array.prototype.every.call("hello\nworld\\!", callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call("hello\nworld\\!", callbackfn), false, 'Array.prototype.every.call("hello\nworld\\!", callbackfn)');
|
||||
|
@ -4,16 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-8
|
||||
description: Array.prototype.every applied to String object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return !(obj instanceof String);
|
||||
}
|
||||
|
||||
var obj = new String("hello\nworld\\!");
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-1-9
|
||||
description: Array.prototype.every applied to Function object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
return !(obj instanceof Function);
|
||||
}
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
obj[0] = 11;
|
||||
obj[1] = 9;
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-1
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -25,7 +23,5 @@ function testcase() {
|
||||
length: 2
|
||||
};
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-10
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
inherited accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -35,7 +33,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn1) &&
|
||||
!Array.prototype.every.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(child, callbackfn2), false, 'Array.prototype.every.call(child, callbackfn2)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-2-11
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own accessor property without a get function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -27,6 +24,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-2-13
|
||||
description: >
|
||||
Array.prototype.every applied to the Array-like object that
|
||||
'length' is inherited accessor property without a get function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -31,6 +28,5 @@ function testcase() {
|
||||
child[0] = 9;
|
||||
child[1] = 8;
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn), 'Array.prototype.every.call(child, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-2-14
|
||||
description: >
|
||||
Array.prototype.every applied to the Array-like object that
|
||||
'length' property doesn't exist
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 12 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-17
|
||||
description: >
|
||||
Array.prototype.every applied to the Arguments object, which
|
||||
implements its own property get method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -24,6 +22,4 @@ function testcase() {
|
||||
!Array.prototype.every.call(arguments, callbackfn2);
|
||||
};
|
||||
|
||||
return func(12, 11);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(func(12, 11), 'func(12, 11) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-19
|
||||
description: >
|
||||
Array.prototype.every applied to Function object, which implements
|
||||
its own property get method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -25,7 +23,5 @@ function testcase() {
|
||||
fun[1] = 11;
|
||||
fun[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(fun, callbackfn1) &&
|
||||
!Array.prototype.every.call(fun, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(fun, callbackfn1), 'Array.prototype.every.call(fun, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(fun, callbackfn2), false, 'Array.prototype.every.call(fun, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-3
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own data property that overrides an inherited data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -29,7 +27,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn1) &&
|
||||
!Array.prototype.every.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(child, callbackfn2), false, 'Array.prototype.every.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-5
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own data property that overrides an inherited accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -40,7 +38,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn1) &&
|
||||
!Array.prototype.every.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(child, callbackfn2), false, 'Array.prototype.every.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-6
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
inherited data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -28,7 +26,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn1) &&
|
||||
!Array.prototype.every.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(child, callbackfn2), false, 'Array.prototype.every.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-7
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -31,7 +29,5 @@ function testcase() {
|
||||
obj[1] = 11;
|
||||
obj[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-8
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own accessor property that overrides an inherited data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -36,7 +34,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn1) &&
|
||||
!Array.prototype.every.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(child, callbackfn2), false, 'Array.prototype.every.call(child, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-9
|
||||
description: >
|
||||
Array.prototype.every applied to Array-like object, 'length' is an
|
||||
own accessor property that overrides an inherited accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -43,7 +41,5 @@ function testcase() {
|
||||
child[1] = 11;
|
||||
child[2] = 9;
|
||||
|
||||
return Array.prototype.every.call(child, callbackfn1) &&
|
||||
!Array.prototype.every.call(child, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(child, callbackfn2), false, 'Array.prototype.every.call(child, callbackfn2)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-3-1
|
||||
description: Array.prototype.every - value of 'length' is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: undefined };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-3-10
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a number (value is
|
||||
NaN)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: NaN };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-11
|
||||
description: >
|
||||
Array.prototype.every - 'length' is a string containing a positive
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: "2" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-12
|
||||
description: >
|
||||
Array.prototype.every - 'length' is a string containing a negative
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-13
|
||||
description: >
|
||||
Array.prototype.every - 'length' is a string containing a decimal
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-3-14
|
||||
description: Array.prototype.every - 'length' is a string containing +/-Infinity
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,8 +17,7 @@ function testcase() {
|
||||
var objTwo = { 0: 9, length: "+Infinity" };
|
||||
var objThree = { 0: 9, length: "-Infinity" };
|
||||
|
||||
return !Array.prototype.every.call(objOne, callbackfn) &&
|
||||
!Array.prototype.every.call(objTwo, callbackfn) &&
|
||||
Array.prototype.every.call(objThree, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(objOne, callbackfn), false, 'Array.prototype.every.call(objOne, callbackfn)');
|
||||
assert.sameValue(Array.prototype.every.call(objTwo, callbackfn), false, 'Array.prototype.every.call(objTwo, callbackfn)');
|
||||
assert(Array.prototype.every.call(objThree, callbackfn), 'Array.prototype.every.call(objThree, callbackfn) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-15
|
||||
description: >
|
||||
Array.prototype.every - 'length' is a string containing an
|
||||
exponential number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-16
|
||||
description: >
|
||||
Array.prototype.every - 'length' is a string containing a hex
|
||||
number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-17
|
||||
description: >
|
||||
Array.prototype.every - 'length' is a string containing a number
|
||||
with leading zeros
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-3-18
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a string that can't
|
||||
convert to a number
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, 1: 8, length: "two" };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-19
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is an Object which has
|
||||
an own toString method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -37,7 +35,7 @@ function testcase() {
|
||||
// does not return a primitive value, ES next tries to convert the object
|
||||
// to a number by calling its toString() method and converting the
|
||||
// resulting string to a number.
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2) && toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
assert(toStringAccessed, 'toStringAccessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-3-2
|
||||
description: >
|
||||
Array.prototype.every on an Array-like object if 'length' is 1
|
||||
(length overridden to true(type conversion))
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -21,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 9, length: true };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-20
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is an Object which has
|
||||
an own valueOf method
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -32,7 +30,6 @@ function testcase() {
|
||||
}
|
||||
};
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2) && valueOfAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.every - 'length' is an object that has an own
|
||||
valueOf method that returns an object and toString method that
|
||||
returns a string
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -38,9 +36,7 @@ function testcase() {
|
||||
}
|
||||
};
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2) &&
|
||||
valueOfAccessed &&
|
||||
toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
assert(toStringAccessed, 'toStringAccessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-3-23
|
||||
description: >
|
||||
Array.prototype.every uses inherited valueOf method when 'length'
|
||||
is an object with an own toString and inherited valueOf methods
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -46,8 +43,7 @@ function testcase() {
|
||||
length: child
|
||||
};
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2) &&
|
||||
valueOfAccessed && !toStringAccessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
assert(valueOfAccessed, 'valueOfAccessed !== true');
|
||||
assert.sameValue(toStringAccessed, false, 'toStringAccessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-24
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a positive
|
||||
non-integer, ensure truncation occurs in the proper direction
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-3-25
|
||||
description: Array.prototype.every - value of 'length' is a negative non-integer
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -23,7 +21,5 @@ function testcase() {
|
||||
length: -4294967294.5
|
||||
};
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-29
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is boundary value (2^32
|
||||
+ 1)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -24,7 +22,5 @@ function testcase() {
|
||||
length: 4294967297
|
||||
};
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn1), false, 'Array.prototype.every.call(obj, callbackfn1)');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-3-3
|
||||
description: Array.prototype.every - value of 'length' is a number (value is 0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: 0 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-3-4
|
||||
description: Array.prototype.every - value of 'length' is a number (value is +0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: +0 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-3-5
|
||||
description: Array.prototype.every - value of 'length' is a number (value is -0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: -0 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-6
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a number (value is
|
||||
positive)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: 2 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
!Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-3-7
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a number (value is
|
||||
negative)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn1(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
@ -20,7 +18,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 12, 1: 11, 2: 9, length: -4294967294 }; //length used to exec while loop is 0
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn1) &&
|
||||
Array.prototype.every.call(obj, callbackfn2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
|
||||
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-3-8
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a number (value is
|
||||
Infinity)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: Infinity };
|
||||
|
||||
return !Array.prototype.every.call(obj, callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-3-9
|
||||
description: >
|
||||
Array.prototype.every - value of 'length' is a number (value is
|
||||
-Infinity)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -20,6 +17,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 9, length: -Infinity };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -4,15 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-4-12
|
||||
description: Array.prototype.every - 'callbackfn' is a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
return val > 10;
|
||||
}
|
||||
|
||||
return ![11, 9].every(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue([11, 9].every(callbackfn), false, '[11, 9].every(callbackfn)');
|
||||
|
@ -5,10 +5,8 @@
|
||||
es5id: 15.4.4.16-5-1-s
|
||||
description: Array.prototype.every - thisArg not passed to strict callbackfn
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var innerThisCorrect = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +16,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
[1].every(callbackfn);
|
||||
return innerThisCorrect;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(innerThisCorrect, 'innerThisCorrect !== true');
|
||||
|
@ -5,20 +5,14 @@
|
||||
es5id: 15.4.4.16-5-1
|
||||
description: Array.prototype.every - thisArg not passed
|
||||
flags: [noStrict]
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
return this === fnGlobalObject();
|
||||
}
|
||||
|
||||
var arr = [1];
|
||||
if(arr.every(callbackfn) === true)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-10
|
||||
description: Array.prototype.every - Array Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objArray = [];
|
||||
|
||||
@ -19,6 +16,5 @@ function testcase() {
|
||||
|
||||
|
||||
|
||||
return [11].every(callbackfn, objArray) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objArray), '[11].every(callbackfn, objArray) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-11
|
||||
description: Array.prototype.every - String Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objString = new String();
|
||||
|
||||
@ -19,6 +16,5 @@ function testcase() {
|
||||
|
||||
|
||||
|
||||
return [11].every(callbackfn, objString) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objString), '[11].every(callbackfn, objString) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-12
|
||||
description: Array.prototype.every - Boolean Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objBoolean = new Boolean();
|
||||
|
||||
@ -19,6 +16,5 @@ function testcase() {
|
||||
|
||||
|
||||
|
||||
return [11].every(callbackfn, objBoolean) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objBoolean), '[11].every(callbackfn, objBoolean) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-13
|
||||
description: Array.prototype.every - Number Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objNumber = new Number();
|
||||
|
||||
@ -17,6 +14,5 @@ function testcase() {
|
||||
return this === objNumber;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, objNumber) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objNumber), '[11].every(callbackfn, objNumber) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-14
|
||||
description: Array.prototype.every - the Math object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
return this === Math;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, Math) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, Math), '[11].every(callbackfn, Math) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-15
|
||||
description: Array.prototype.every - Date Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objDate = new Date();
|
||||
|
||||
@ -17,6 +14,5 @@ function testcase() {
|
||||
return this === objDate;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, objDate) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objDate), '[11].every(callbackfn, objDate) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-16
|
||||
description: Array.prototype.every - RegExp Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objRegExp = new RegExp();
|
||||
|
||||
@ -17,6 +14,5 @@ function testcase() {
|
||||
return this === objRegExp;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, objRegExp) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objRegExp), '[11].every(callbackfn, objRegExp) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-17
|
||||
description: Array.prototype.every - the JSON object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -15,6 +13,5 @@ function testcase() {
|
||||
return this === JSON;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, JSON) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, JSON), '[11].every(callbackfn, JSON) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-18
|
||||
description: Array.prototype.every - Error Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objError = new RangeError();
|
||||
|
||||
@ -17,6 +14,5 @@ function testcase() {
|
||||
return this === objError;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, objError) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objError), '[11].every(callbackfn, objError) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-19
|
||||
description: Array.prototype.every - the Arguments object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var arg;
|
||||
|
||||
@ -21,6 +18,5 @@ function testcase() {
|
||||
arg = arguments;
|
||||
}(1, 2, 3));
|
||||
|
||||
return [11].every(callbackfn, arg) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, arg), '[11].every(callbackfn, arg) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-2
|
||||
description: Array.prototype.every - thisArg is Object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
var o = new Object();
|
||||
o.res = true;
|
||||
@ -17,8 +15,5 @@ function testcase() {
|
||||
}
|
||||
|
||||
var arr = [1];
|
||||
if(arr.every(callbackfn, o) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.every(callbackfn, o), true, 'arr.every(callbackfn, o)');
|
||||
|
@ -4,13 +4,9 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-21
|
||||
description: Array.prototype.every - the global object can be used as thisArg
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +14,5 @@ function testcase() {
|
||||
return this === fnGlobalObject();
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, fnGlobalObject()) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, fnGlobalObject()), '[11].every(callbackfn, fnGlobalObject()) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-22
|
||||
description: Array.prototype.every - boolean primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
return this.valueOf() === false;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, false) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, false), '[11].every(callbackfn, false) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-23
|
||||
description: Array.prototype.every - number primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
return this.valueOf() === 101;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, 101) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, 101), '[11].every(callbackfn, 101) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-24
|
||||
description: Array.prototype.every - string primitive can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
return this.valueOf() === "abc";
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, "abc") && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, "abc"), '[11].every(callbackfn, "abc") !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-3
|
||||
description: Array.prototype.every - thisArg is Array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
var a = new Array();
|
||||
a.res = true;
|
||||
@ -18,8 +16,4 @@ function testcase() {
|
||||
|
||||
var arr = [1];
|
||||
|
||||
if(arr.every(callbackfn, a) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.every(callbackfn, a), true, 'arr.every(callbackfn, a)');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-5-4
|
||||
description: >
|
||||
Array.prototype.every - thisArg is object from object
|
||||
template(prototype)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -21,8 +19,4 @@ function testcase() {
|
||||
var f = new foo();
|
||||
var arr = [1];
|
||||
|
||||
if(arr.every(callbackfn,f) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.every(callbackfn,f), true, 'arr.every(callbackfn,f)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-5
|
||||
description: Array.prototype.every - thisArg is object from object template
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -19,8 +17,4 @@ function testcase() {
|
||||
f.res = true;
|
||||
var arr = [1];
|
||||
|
||||
if(arr.every(callbackfn,f) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.every(callbackfn,f), true, 'arr.every(callbackfn,f)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-6
|
||||
description: Array.prototype.every - thisArg is function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var res = false;
|
||||
function callbackfn(val, idx, obj)
|
||||
{
|
||||
@ -18,8 +16,4 @@ function testcase() {
|
||||
foo.res = true;
|
||||
var arr = [1];
|
||||
|
||||
if(arr.every(callbackfn,foo) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.every(callbackfn,foo), true, 'arr.every(callbackfn,foo)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-7
|
||||
description: Array.prototype.every - built-in functions can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -16,6 +13,5 @@ function testcase() {
|
||||
return this === eval;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, eval) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, eval), '[11].every(callbackfn, eval) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-5-9
|
||||
description: Array.prototype.every - Function Object can be used as thisArg
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
var objFunction = function () { };
|
||||
|
||||
@ -17,6 +14,5 @@ function testcase() {
|
||||
return this === objFunction;
|
||||
}
|
||||
|
||||
return [11].every(callbackfn, objFunction) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert([11].every(callbackfn, objFunction), '[11].every(callbackfn, objFunction) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-1
|
||||
description: >
|
||||
Array.prototype.every considers new elements added to array after
|
||||
the call
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var calledForThree = false;
|
||||
|
||||
function callbackfn(val, Idx, obj)
|
||||
@ -25,6 +22,4 @@ function testcase() {
|
||||
|
||||
var res = arr.every(callbackfn);
|
||||
|
||||
return calledForThree;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(calledForThree, 'calledForThree !== true');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-2
|
||||
description: >
|
||||
Array.prototype.every considers new value of elements in array
|
||||
after the call
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, Idx, obj)
|
||||
{
|
||||
arr[4] = 6;
|
||||
@ -22,8 +19,5 @@ function testcase() {
|
||||
|
||||
var arr = [1,2,3,4,5];
|
||||
|
||||
if(arr.every(callbackfn) === false)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-3
|
||||
description: >
|
||||
Array.prototype.every doesn't visit deleted elements in array
|
||||
after the call
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, Idx, obj)
|
||||
{
|
||||
delete arr[2];
|
||||
@ -22,8 +19,5 @@ function testcase() {
|
||||
|
||||
var arr = [1,2,3,4,5];
|
||||
|
||||
if(arr.every(callbackfn) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-4
|
||||
description: >
|
||||
Array.prototype.every doesn't visit deleted elements when
|
||||
Array.length is decreased
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, Idx, obj)
|
||||
{
|
||||
arr.length = 3;
|
||||
@ -22,8 +19,5 @@ function testcase() {
|
||||
|
||||
var arr = [1,2,3,4,6];
|
||||
|
||||
if(arr.every(callbackfn) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-5
|
||||
description: >
|
||||
Array.prototype.every doesn't consider newly added elements in
|
||||
sparse array
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, Idx, obj)
|
||||
{
|
||||
arr[1000] = 3;
|
||||
@ -24,8 +21,5 @@ function testcase() {
|
||||
arr[1] = 1;
|
||||
arr[2] = 2;
|
||||
|
||||
if(arr.every(callbackfn) === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-6
|
||||
description: >
|
||||
Array.prototype.every visits deleted element in array after the
|
||||
call when same index is also present in prototype
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function callbackfn(val, Idx, obj)
|
||||
{
|
||||
delete arr[2];
|
||||
@ -26,8 +23,4 @@ function testcase() {
|
||||
var res = arr.every(callbackfn);
|
||||
delete Array.prototype[2];
|
||||
|
||||
if(res === false)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(res, false, 'res');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.every - Deleting the array itself within the
|
||||
callbackfn of Array.prototype.every is successful once
|
||||
Array.prototype.every is called for all elements
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = new Object();
|
||||
o.arr = [1, 2, 3, 4, 5];
|
||||
|
||||
@ -22,6 +20,5 @@ function testcase() {
|
||||
return false;
|
||||
}
|
||||
|
||||
return o.arr.every(callbackfn) && !o.hasOwnProperty("arr");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(o.arr.every(callbackfn), 'o.arr.every(callbackfn) !== true');
|
||||
assert.sameValue(o.hasOwnProperty("arr"), false, 'o.hasOwnProperty("arr")');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-7-8
|
||||
description: Array.prototype.every - no observable effects occur if len is 0
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var accessed = false;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -18,6 +15,5 @@ function testcase() {
|
||||
|
||||
var obj = { 0: 11, 1: 12, length: 0 };
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && !accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(accessed, false, 'accessed');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-9
|
||||
description: >
|
||||
Array.prototype.every - modifications to length don't change
|
||||
number of iterations
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var called = 0;
|
||||
|
||||
function callbackfn(val, idx, obj) {
|
||||
@ -28,6 +25,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return Array.prototype.every.call(obj, callbackfn) && 2 === called;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
|
||||
assert.sameValue(called, 2, 'called');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-b-1
|
||||
description: >
|
||||
Array.prototype.every - callbackfn not called for indexes never
|
||||
been assigned values
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var callCnt = 0.;
|
||||
function callbackfn(val, Idx, obj)
|
||||
{
|
||||
@ -21,7 +18,5 @@ function testcase() {
|
||||
var arr = new Array(10);
|
||||
arr[1] = undefined;
|
||||
arr.every(callbackfn);
|
||||
if( callCnt === 1)
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(callCnt, 1, 'callCnt');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-14
|
||||
description: >
|
||||
Array.prototype.every - decreasing length of array causes index
|
||||
property not to be visited
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var accessed = false;
|
||||
function callbackfn(val, idx, obj) {
|
||||
accessed = true;
|
||||
@ -25,6 +23,5 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return arr.every(callbackfn) && accessed;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true');
|
||||
assert(accessed, 'accessed !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
Array.prototype.every - decreasing length of array does not delete
|
||||
non-configurable properties
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 2 && val === "unconfigurable") {
|
||||
return false;
|
||||
@ -36,6 +34,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !arr.every(callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)');
|
||||
|
@ -4,10 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.4.4.16-7-b-2
|
||||
description: Array.prototype.every - added properties in step 2 are visible here
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function callbackfn(val, idx, obj) {
|
||||
if (idx === 2 && val === "length") {
|
||||
return false;
|
||||
@ -26,6 +24,4 @@ function testcase() {
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return !Array.prototype.every.call(arr, callbackfn);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)');
|
||||
|
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