add esid to array/prototype/every (#1098)

This commit is contained in:
Sue Lockwood 2017-06-30 07:32:12 -07:00 committed by Leo Balter
parent 1319061ff7
commit e9c50b3ac2
210 changed files with 726 additions and 516 deletions

View File

@ -2,10 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.4.4.16-0-1
esid: sec-array.prototype.every
es5id: 15.4.4.16
description: Array.prototype.every must exist as a function
---*/
var f = Array.prototype.every;
var f = Array.prototype.every;
assert.sameValue(typeof(f), "function", 'typeof(f)');

View File

@ -2,11 +2,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-1
description: Array.prototype.every applied to undefined throws a TypeError
---*/
assert.throws(TypeError, function() {
Array.prototype.every.call(undefined); // TypeError is thrown if value is undefined
Array.prototype.every.call(undefined); // TypeError is thrown if value is undefined
});

View File

@ -2,15 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-10
description: Array.prototype.every applied to the Math object
---*/
function callbackfn(val, idx, obj) {
return ('[object Math]' !== Object.prototype.toString.call(obj));
}
function callbackfn(val, idx, obj) {
return ('[object Math]' !== Object.prototype.toString.call(obj));
}
Math.length = 1;
Math[0] = 1;
Math.length = 1;
Math[0] = 1;
assert.sameValue(Array.prototype.every.call(Math, callbackfn), false, 'Array.prototype.every.call(Math, callbackfn)');

View File

@ -2,16 +2,17 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-11
description: Array.prototype.every applied to Date object
---*/
function callbackfn(val, idx, obj) {
return !(obj instanceof Date);
}
function callbackfn(val, idx, obj) {
return !(obj instanceof Date);
}
var obj = new Date();
obj.length = 1;
obj[0] = 1;
var obj = new Date();
obj.length = 1;
obj[0] = 1;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');

View File

@ -2,16 +2,17 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-12
description: Array.prototype.every applied to RegExp object
---*/
function callbackfn(val, idx, obj) {
return !(obj instanceof RegExp);
}
function callbackfn(val, idx, obj) {
return !(obj instanceof RegExp);
}
var obj = new RegExp();
obj.length = 1;
obj[0] = 1;
var obj = new RegExp();
obj.length = 1;
obj[0] = 1;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');

View File

@ -2,15 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-13
description: Array.prototype.every applied to the JSON object
---*/
function callbackfn(val, idx, obj) {
return ('[object JSON]' !== Object.prototype.toString.call(obj));
}
function callbackfn(val, idx, obj) {
return ('[object JSON]' !== Object.prototype.toString.call(obj));
}
JSON.length = 1;
JSON[0] = 1;
JSON.length = 1;
JSON[0] = 1;
assert.sameValue(Array.prototype.every.call(JSON, callbackfn), false, 'Array.prototype.every.call(JSON, callbackfn)');

View File

@ -2,16 +2,17 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-14
description: Array.prototype.every applied to Error object
---*/
function callbackfn(val, idx, obj) {
return !(obj instanceof Error);
}
function callbackfn(val, idx, obj) {
return !(obj instanceof Error);
}
var obj = new Error();
obj.length = 1;
obj[0] = 1;
var obj = new Error();
obj.length = 1;
obj[0] = 1;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');

View File

@ -2,16 +2,17 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-15
description: Array.prototype.every applied to the Arguments object
---*/
function callbackfn(val, idx, obj) {
return ('[object Arguments]' !== Object.prototype.toString.call(obj));
}
function callbackfn(val, idx, obj) {
return ('[object Arguments]' !== Object.prototype.toString.call(obj));
}
var obj = (function fun() {
return arguments;
}("a", "b"));
var obj = (function fun() {
return arguments;
}("a", "b"));
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');

View File

@ -2,11 +2,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-2
description: Array.prototype.every applied to null throws a TypeError
---*/
assert.throws(TypeError, function() {
Array.prototype.every.call(null); // TypeError is thrown if value is null
Array.prototype.every.call(null); // TypeError is thrown if value is null
});

View File

@ -2,19 +2,20 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-3
description: Array.prototype.every applied to boolean primitive
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Boolean;
}
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Boolean;
}
Boolean.prototype[0] = 1;
Boolean.prototype.length = 1;
Boolean.prototype[0] = 1;
Boolean.prototype.length = 1;
assert(Array.prototype.every.call(false, callbackfn), 'Array.prototype.every.call(false, callbackfn) !== true');
assert(accessed, 'accessed !== true');

View File

@ -2,20 +2,21 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-4
description: Array.prototype.every applied to Boolean object
---*/
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Boolean;
}
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Boolean;
}
var obj = new Boolean(true);
obj.length = 2;
obj[0] = 11;
obj[1] = 12;
var obj = new Boolean(true);
obj.length = 2;
obj[0] = 11;
obj[1] = 12;
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert(accessed, 'accessed !== true');

View File

@ -2,18 +2,19 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-5
description: Array.prototype.every applied to number primitive
---*/
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Number;
}
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Number;
}
Number.prototype[0] = 1;
Number.prototype.length = 1;
Number.prototype[0] = 1;
Number.prototype.length = 1;
assert(Array.prototype.every.call(2.5, callbackfn), 'Array.prototype.every.call(2.5, callbackfn) !== true');
assert(accessed, 'accessed !== true');

View File

@ -2,20 +2,21 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-6
description: Array.prototype.every applied to Number object
---*/
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Number;
}
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return obj instanceof Number;
}
var obj = new Number(-128);
obj.length = 2;
obj[0] = 11;
obj[1] = 12;
var obj = new Number(-128);
obj.length = 2;
obj[0] = 11;
obj[1] = 12;
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert(accessed, 'accessed !== true');

View File

@ -2,12 +2,13 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-7
description: Array.prototype.every applied to string primitive
---*/
function callbackfn(val, idx, obj) {
return !(obj instanceof String);
}
function callbackfn(val, idx, obj) {
return !(obj instanceof String);
}
assert.sameValue(Array.prototype.every.call("hello\nworld\\!", callbackfn), false, 'Array.prototype.every.call("hello\nworld\\!", callbackfn)');

View File

@ -2,14 +2,15 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-8
description: Array.prototype.every applied to String object
---*/
function callbackfn(val, idx, obj) {
return !(obj instanceof String);
}
function callbackfn(val, idx, obj) {
return !(obj instanceof String);
}
var obj = new String("hello\nworld\\!");
var obj = new String("hello\nworld\\!");
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');

View File

@ -2,18 +2,19 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-1-9
description: Array.prototype.every applied to Function object
---*/
function callbackfn(val, idx, obj) {
return !(obj instanceof Function);
}
function callbackfn(val, idx, obj) {
return !(obj instanceof Function);
}
var obj = function (a, b) {
return a + b;
};
obj[0] = 11;
obj[1] = 9;
var obj = function (a, b) {
return a + b;
};
obj[0] = 11;
obj[1] = 9;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');

View File

@ -2,26 +2,27 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-1
description: >
Array.prototype.every applied to Array-like object, 'length' is an
own data property
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = {
0: 12,
1: 11,
2: 9,
length: 2
};
var obj = {
0: 12,
1: 11,
2: 9,
length: 2
};
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)');

View File

@ -2,36 +2,37 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-10
description: >
Array.prototype.every applied to Array-like object, 'length' is an
inherited accessor property
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var proto = { };
var proto = { };
Object.defineProperty(proto, "length", {
get: function () {
return 2;
},
configurable: true
});
Object.defineProperty(proto, "length", {
get: function () {
return 2;
},
configurable: true
});
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
child[0] = 12;
child[1] = 11;
child[2] = 9;
var child = new Con();
child[0] = 12;
child[1] = 11;
child[2] = 9;
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)');

View File

@ -2,27 +2,28 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var obj = {
0: 9,
1: 8
};
Object.defineProperty(obj, "length", {
set: function () { },
configurable: true
});
var obj = {
0: 9,
1: 8
};
Object.defineProperty(obj, "length", {
set: function () { },
configurable: true
});
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,31 +2,32 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-12
description: >
Array.prototype.every - 'length' is own accessor property without
a get function that overrides an inherited accessor property
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
Object.defineProperty(Object.prototype, "length", {
get: function () {
return 2;
},
configurable: true
});
Object.defineProperty(Object.prototype, "length", {
get: function () {
return 2;
},
configurable: true
});
var obj = { 0: 9, 1: 8 };
Object.defineProperty(obj, "length", {
set: function () { },
configurable: true
});
var obj = { 0: 9, 1: 8 };
Object.defineProperty(obj, "length", {
set: function () { },
configurable: true
});
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,31 +2,32 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var proto = {};
Object.defineProperty(proto, "length", {
set: function () { },
configurable: true
});
var proto = {};
Object.defineProperty(proto, "length", {
set: function () { },
configurable: true
});
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
child[0] = 9;
child[1] = 8;
var child = new Con();
child[0] = 9;
child[1] = 8;
assert(Array.prototype.every.call(child, callbackfn), 'Array.prototype.every.call(child, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,20 +2,21 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-14
description: >
Array.prototype.every applied to the Array-like object that
'length' property doesn't exist
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var obj = { 0: 11, 1: 12 };
var obj = { 0: 11, 1: 12 };
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-17
description: >
Array.prototype.every applied to the Arguments object, which
implements its own property get method
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var func = function (a, b) {
arguments[2] = 9;
return Array.prototype.every.call(arguments, callbackfn1) &&
!Array.prototype.every.call(arguments, callbackfn2);
};
var func = function (a, b) {
arguments[2] = 9;
return Array.prototype.every.call(arguments, callbackfn1) &&
!Array.prototype.every.call(arguments, callbackfn2);
};
assert(func(12, 11), 'func(12, 11) !== true');

View File

@ -2,23 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-18
description: >
Array.prototype.every applied to String object, which implements
its own property get method
---*/
function callbackfn1(val, idx, obj) {
return parseInt(val, 10) > 1;
}
function callbackfn1(val, idx, obj) {
return parseInt(val, 10) > 1;
}
function callbackfn2(val, idx, obj) {
return parseInt(val, 10) > 2;
}
function callbackfn2(val, idx, obj) {
return parseInt(val, 10) > 2;
}
var str = new String("432");
var str = new String("432");
String.prototype[3] = "1";
String.prototype[3] = "1";
assert(Array.prototype.every.call(str, callbackfn1), 'Array.prototype.every.call(str, callbackfn1) !== true');
assert.sameValue(Array.prototype.every.call(str, callbackfn2), false, 'Array.prototype.every.call(str, callbackfn2)');

View File

@ -2,26 +2,27 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-19
description: >
Array.prototype.every applied to Function object, which implements
its own property get method
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var fun = function (a, b) {
return a + b;
};
fun[0] = 12;
fun[1] = 11;
fun[2] = 9;
var fun = function (a, b) {
return a + b;
};
fun[0] = 12;
fun[1] = 11;
fun[2] = 9;
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)');

View File

@ -2,19 +2,20 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-2
description: Array.prototype.every - 'length' is own data property on an Array
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
Array.prototype[2] = 9;
Array.prototype[2] = 9;
assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true');
assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)');

View File

@ -2,30 +2,31 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var proto = { length: 3 };
var proto = { length: 3 };
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
child.length = 2;
child[0] = 12;
child[1] = 11;
child[2] = 9;
var child = new Con();
child.length = 2;
child[0] = 12;
child[1] = 11;
child[2] = 9;
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)');

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-4
description: >
Array.prototype.every - 'length' is own data property that
overrides an inherited data property on an Array
---*/
var arrProtoLen = 0;
function callbackfn1(val, idx, obj) {
return val > 10;
}
var arrProtoLen = 0;
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
arrProtoLen = Array.prototype.length;
Array.prototype.length = 0;
Array.prototype[2] = 9;
arrProtoLen = Array.prototype.length;
Array.prototype.length = 0;
Array.prototype[2] = 9;
assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true');
assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)');

View File

@ -2,41 +2,42 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var proto = { };
var proto = { };
Object.defineProperty(proto, "length", {
get: function () {
return 3;
},
configurable: true
});
Object.defineProperty(proto, "length", {
get: function () {
return 3;
},
configurable: true
});
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
child[0] = 12;
child[1] = 11;
child[2] = 9;
var child = new Con();
child[0] = 12;
child[1] = 11;
child[2] = 9;
Object.defineProperty(child, "length", {
value: 2,
configurable: true
});
Object.defineProperty(child, "length", {
value: 2,
configurable: true
});
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)');

View File

@ -2,29 +2,30 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-6
description: >
Array.prototype.every applied to Array-like object, 'length' is an
inherited data property
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var proto = { length: 2 };
var proto = { length: 2 };
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
child[0] = 12;
child[1] = 11;
child[2] = 9;
var child = new Con();
child[0] = 12;
child[1] = 11;
child[2] = 9;
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)');

View File

@ -2,32 +2,33 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-2-7
description: >
Array.prototype.every applied to Array-like object, 'length' is an
own accessor property
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { };
var obj = { };
Object.defineProperty(obj, "length", {
get: function () {
return 2;
},
configurable: true
});
Object.defineProperty(obj, "length", {
get: function () {
return 2;
},
configurable: true
});
obj[0] = 12;
obj[1] = 11;
obj[2] = 9;
obj[0] = 12;
obj[1] = 11;
obj[2] = 9;
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)');

View File

@ -2,37 +2,38 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var proto = { length: 3 };
var proto = { length: 3 };
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
var child = new Con();
Object.defineProperty(child, "length", {
get: function () {
return 2;
},
configurable: true
});
Object.defineProperty(child, "length", {
get: function () {
return 2;
},
configurable: true
});
child[0] = 12;
child[1] = 11;
child[2] = 9;
child[0] = 12;
child[1] = 11;
child[2] = 9;
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)');

View File

@ -2,44 +2,45 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var proto = {};
var proto = {};
Object.defineProperty(proto, "length", {
get: function () {
return 3;
},
configurable: true
});
Object.defineProperty(proto, "length", {
get: function () {
return 3;
},
configurable: true
});
var Con = function () { };
Con.prototype = proto;
var Con = function () { };
Con.prototype = proto;
var child = new Con();
var child = new Con();
Object.defineProperty(child, "length", {
get: function () {
return 2;
},
configurable: true
});
Object.defineProperty(child, "length", {
get: function () {
return 2;
},
configurable: true
});
child[0] = 12;
child[1] = 11;
child[2] = 9;
child[0] = 12;
child[1] = 11;
child[2] = 9;
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)');

View File

@ -2,18 +2,19 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-1
description: Array.prototype.every - value of 'length' is undefined
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var obj = { 0: 9, length: undefined };
var obj = { 0: 9, length: undefined };
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,20 +2,21 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-10
description: >
Array.prototype.every - value of 'length' is a number (value is
NaN)
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var obj = { 0: 9, length: NaN };
var obj = { 0: 9, length: NaN };
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-11
description: >
Array.prototype.every - 'length' is a string containing a positive
number
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 12, 1: 11, 2: 9, length: "2" };
var obj = { 0: 12, 1: 11, 2: 9, length: "2" };
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)');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-12
description: >
Array.prototype.every - 'length' is a string containing a negative
number
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" };
var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" };
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== true');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-13
description: >
Array.prototype.every - 'length' is a string containing a decimal
number
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" };
var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" };
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)');

View File

@ -2,20 +2,21 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-14
description: Array.prototype.every - 'length' is a string containing +/-Infinity
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var objOne = { 0: 9, length: "Infinity" };
var objTwo = { 0: 9, length: "+Infinity" };
var objThree = { 0: 9, length: "-Infinity" };
var objOne = { 0: 9, length: "Infinity" };
var objTwo = { 0: 9, length: "+Infinity" };
var objThree = { 0: 9, length: "-Infinity" };
assert.sameValue(Array.prototype.every.call(objOne, callbackfn), false, 'Array.prototype.every.call(objOne, callbackfn)');
assert.sameValue(Array.prototype.every.call(objTwo, callbackfn), false, 'Array.prototype.every.call(objTwo, callbackfn)');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-15
description: >
Array.prototype.every - 'length' is a string containing an
exponential number
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" };
var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" };
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)');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-16
description: >
Array.prototype.every - 'length' is a string containing a hex
number
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" };
var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" };
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)');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-17
description: >
Array.prototype.every - 'length' is a string containing a number
with leading zeros
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" };
var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" };
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)');

View File

@ -2,20 +2,21 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-18
description: >
Array.prototype.every - value of 'length' is a string that can't
convert to a number
---*/
var accessed = false;
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
function callbackfn(val, idx, obj) {
accessed = true;
return val > 10;
}
var obj = { 0: 9, 1: 8, length: "two" };
var obj = { 0: 9, 1: 8, length: "two" };
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed');

View File

@ -2,39 +2,40 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-19
description: >
Array.prototype.every - value of 'length' is an Object which has
an own toString method
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var toStringAccessed = false;
var obj = {
0: 12,
1: 11,
2: 9,
length: {
toString: function () {
toStringAccessed = true;
return '2';
}
}
};
function callbackfn2(val, idx, obj) {
return val > 11;
}
var toStringAccessed = false;
var obj = {
0: 12,
1: 11,
2: 9,
length: {
toString: function () {
toStringAccessed = true;
return '2';
}
}
};
// objects inherit the default valueOf() method from Object
// that simply returns itself. Since the default valueOf() method
// 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.
// objects inherit the default valueOf() method from Object
// that simply returns itself. Since the default valueOf() method
// 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.
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)');

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
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))
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var obj = { 0: 11, 1: 9, length: true };
var obj = { 0: 11, 1: 9, length: true };
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
assert.sameValue(Array.prototype.every.call(obj, callbackfn2), false, 'Array.prototype.every.call(obj, callbackfn2)');

View File

@ -2,33 +2,34 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-20
description: >
Array.prototype.every - value of 'length' is an Object which has
an own valueOf method
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var valueOfAccessed = false;
var valueOfAccessed = false;
var obj = {
0: 12,
1: 11,
2: 9,
length: {
valueOf: function () {
valueOfAccessed = true;
return 2;
}
}
};
var obj = {
0: 12,
1: 11,
2: 9,
length: {
valueOf: function () {
valueOfAccessed = true;
return 2;
}
}
};
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)');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-21
description: >
Array.prototype.every - 'length' is an object that has an own
@ -9,32 +10,32 @@ description: >
returns a string
---*/
function callbackfn1(val, idx, obj) {
return val > 10;
function callbackfn1(val, idx, obj) {
return val > 10;
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var toStringAccessed = false;
var valueOfAccessed = false;
var obj = {
0: 12,
1: 11,
2: 9,
length: {
valueOf: function () {
valueOfAccessed = true;
return {};
},
toString: function () {
toStringAccessed = true;
return '2';
}
function callbackfn2(val, idx, obj) {
return val > 11;
}
var toStringAccessed = false;
var valueOfAccessed = false;
var obj = {
0: 12,
1: 11,
2: 9,
length: {
valueOf: function () {
valueOfAccessed = true;
return {};
},
toString: function () {
toStringAccessed = true;
return '2';
}
}
};
}
};
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)');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-22
description: >
Array.prototype.every throws TypeError exception when 'length' is

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-23
description: >
Array.prototype.every uses inherited valueOf method when 'length'

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-24
description: >
Array.prototype.every - value of 'length' is a positive

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-25
description: Array.prototype.every - value of 'length' is a negative non-integer
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-29
description: >
Array.prototype.every - value of 'length' is boundary value (2^32

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-3
description: Array.prototype.every - value of 'length' is a number (value is 0)
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-4
description: Array.prototype.every - value of 'length' is a number (value is +0)
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-5
description: Array.prototype.every - value of 'length' is a number (value is -0)
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-6
description: >
Array.prototype.every - value of 'length' is a number (value is

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-7
description: >
Array.prototype.every - value of 'length' is a number (value is

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-8
description: >
Array.prototype.every - value of 'length' is a number (value is

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-3-9
description: >
Array.prototype.every - value of 'length' is a number (value is

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-1
description: Array.prototype.every throws TypeError if callbackfn is undefined
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-10
description: >
Array.prototype.every - the exception is not thrown if exception

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-11
description: >
Array.prototype.every - the exception is not thrown if exception

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-12
description: Array.prototype.every - 'callbackfn' is a function
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-15
description: >
Array.prototype.every - calling with no callbackfn is the same as

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-3
description: Array.prototype.every throws TypeError if callbackfn is null
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-4
description: Array.prototype.every throws TypeError if callbackfn is boolean
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-5
description: Array.prototype.every throws TypeError if callbackfn is number
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-6
description: Array.prototype.every throws TypeError if callbackfn is string
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-7
description: >
Array.prototype.every throws TypeError if callbackfn is Object

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-8
description: >
Array.prototype.every - side effects produced by step 2 are

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-4-9
description: >
Array.prototype.every - side effects produced by step 3 are

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-1-s
description: Array.prototype.every - thisArg not passed to strict callbackfn
flags: [noStrict]

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-1
description: Array.prototype.every - thisArg not passed
flags: [noStrict]

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-10
description: Array.prototype.every - Array Object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-11
description: Array.prototype.every - String Object can be used as thisArg
---*/
@ -14,7 +15,7 @@ description: Array.prototype.every - String Object can be used as thisArg
return this === objString;
}
assert([11].every(callbackfn, objString), '[11].every(callbackfn, objString) !== true');
assert(accessed, 'accessed !== true');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-12
description: Array.prototype.every - Boolean Object can be used as thisArg
---*/
@ -14,7 +15,7 @@ description: Array.prototype.every - Boolean Object can be used as thisArg
return this === objBoolean;
}
assert([11].every(callbackfn, objBoolean), '[11].every(callbackfn, objBoolean) !== true');
assert(accessed, 'accessed !== true');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-13
description: Array.prototype.every - Number Object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-14
description: Array.prototype.every - the Math object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-15
description: Array.prototype.every - Date Object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-16
description: Array.prototype.every - RegExp Object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-17
description: Array.prototype.every - the JSON object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-18
description: Array.prototype.every - Error Object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-19
description: Array.prototype.every - the Arguments object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-2
description: Array.prototype.every - thisArg is Object
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-21
description: Array.prototype.every - the global object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-22
description: Array.prototype.every - boolean primitive can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-23
description: Array.prototype.every - number primitive can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-24
description: Array.prototype.every - string primitive can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-3
description: Array.prototype.every - thisArg is Array
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-4
description: >
Array.prototype.every - thisArg is object from object
@ -13,7 +14,7 @@ description: >
{
return this.res;
}
function foo(){}
foo.prototype.res = true;
var f = new foo();

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-5
description: Array.prototype.every - thisArg is object from object template
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-6
description: Array.prototype.every - thisArg is function
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-7
description: Array.prototype.every - built-in functions can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-5-9
description: Array.prototype.every - Function Object can be used as thisArg
---*/

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-1
description: >
Array.prototype.every considers new elements added to array after
@ -19,7 +20,7 @@ description: >
}
var arr = [1,2,,4,5];
var res = arr.every(callbackfn);
assert(calledForThree, 'calledForThree !== true');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-2
description: >
Array.prototype.every considers new value of elements in array
@ -13,11 +14,11 @@ description: >
arr[4] = 6;
if(val < 6)
return true;
else
else
return false;
}
var arr = [1,2,3,4,5];
assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-3
description: >
Array.prototype.every doesn't visit deleted elements in array
@ -13,11 +14,11 @@ description: >
delete arr[2];
if(val == 3)
return false;
else
else
return true;
}
var arr = [1,2,3,4,5];
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-4
description: >
Array.prototype.every doesn't visit deleted elements when
@ -13,11 +14,11 @@ description: >
arr.length = 3;
if(val < 4)
return true;
else
else
return false;
}
var arr = [1,2,3,4,6];
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-5
description: >
Array.prototype.every doesn't consider newly added elements in
@ -13,13 +14,13 @@ description: >
arr[1000] = 3;
if(val < 3)
return true;
else
else
return false;
}
var arr = new Array(10);
arr[1] = 1;
arr[2] = 2;
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-6
description: >
Array.prototype.every visits deleted element in array after the
@ -13,13 +14,13 @@ description: >
delete arr[2];
if(val == 3)
return false;
else
else
return true;
}
Array.prototype[2] = 3;
var arr = [1,2,3,4,5];
var res = arr.every(callbackfn);
delete Array.prototype[2];

Some files were not shown because too many files have changed in this diff Show More