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. // 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 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)'); 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. // 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 es5id: 15.4.4.16-1-1
description: Array.prototype.every applied to undefined throws a TypeError description: Array.prototype.every applied to undefined throws a TypeError
---*/ ---*/
assert.throws(TypeError, function() { 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. // 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 es5id: 15.4.4.16-1-10
description: Array.prototype.every applied to the Math object description: Array.prototype.every applied to the Math object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return ('[object Math]' !== Object.prototype.toString.call(obj)); return ('[object Math]' !== Object.prototype.toString.call(obj));
} }
Math.length = 1; Math.length = 1;
Math[0] = 1; Math[0] = 1;
assert.sameValue(Array.prototype.every.call(Math, callbackfn), false, 'Array.prototype.every.call(Math, callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-11
description: Array.prototype.every applied to Date object description: Array.prototype.every applied to Date object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return !(obj instanceof Date); return !(obj instanceof Date);
} }
var obj = new Date(); var obj = new Date();
obj.length = 1; obj.length = 1;
obj[0] = 1; obj[0] = 1;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-12
description: Array.prototype.every applied to RegExp object description: Array.prototype.every applied to RegExp object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return !(obj instanceof RegExp); return !(obj instanceof RegExp);
} }
var obj = new RegExp(); var obj = new RegExp();
obj.length = 1; obj.length = 1;
obj[0] = 1; obj[0] = 1;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-13
description: Array.prototype.every applied to the JSON object description: Array.prototype.every applied to the JSON object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return ('[object JSON]' !== Object.prototype.toString.call(obj)); return ('[object JSON]' !== Object.prototype.toString.call(obj));
} }
JSON.length = 1; JSON.length = 1;
JSON[0] = 1; JSON[0] = 1;
assert.sameValue(Array.prototype.every.call(JSON, callbackfn), false, 'Array.prototype.every.call(JSON, callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-14
description: Array.prototype.every applied to Error object description: Array.prototype.every applied to Error object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return !(obj instanceof Error); return !(obj instanceof Error);
} }
var obj = new Error(); var obj = new Error();
obj.length = 1; obj.length = 1;
obj[0] = 1; obj[0] = 1;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-15
description: Array.prototype.every applied to the Arguments object description: Array.prototype.every applied to the Arguments object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return ('[object Arguments]' !== Object.prototype.toString.call(obj)); return ('[object Arguments]' !== Object.prototype.toString.call(obj));
} }
var obj = (function fun() { var obj = (function fun() {
return arguments; return arguments;
}("a", "b")); }("a", "b"));
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-2
description: Array.prototype.every applied to null throws a TypeError description: Array.prototype.every applied to null throws a TypeError
---*/ ---*/
assert.throws(TypeError, function() { 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. // 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 es5id: 15.4.4.16-1-3
description: Array.prototype.every applied to boolean primitive description: Array.prototype.every applied to boolean primitive
---*/ ---*/
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return obj instanceof Boolean; return obj instanceof Boolean;
} }
Boolean.prototype[0] = 1; Boolean.prototype[0] = 1;
Boolean.prototype.length = 1; Boolean.prototype.length = 1;
assert(Array.prototype.every.call(false, callbackfn), 'Array.prototype.every.call(false, callbackfn) !== true'); assert(Array.prototype.every.call(false, callbackfn), 'Array.prototype.every.call(false, callbackfn) !== true');
assert(accessed, 'accessed !== true'); assert(accessed, 'accessed !== true');

View File

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

View File

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

View File

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

View File

@ -2,12 +2,13 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-1-7
description: Array.prototype.every applied to string primitive description: Array.prototype.every applied to string primitive
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return !(obj instanceof String); return !(obj instanceof String);
} }
assert.sameValue(Array.prototype.every.call("hello\nworld\\!", callbackfn), false, 'Array.prototype.every.call("hello\nworld\\!", callbackfn)'); 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. // 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 es5id: 15.4.4.16-1-8
description: Array.prototype.every applied to String object description: Array.prototype.every applied to String object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return !(obj instanceof String); 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)'); 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. // 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 es5id: 15.4.4.16-1-9
description: Array.prototype.every applied to Function object description: Array.prototype.every applied to Function object
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return !(obj instanceof Function); return !(obj instanceof Function);
} }
var obj = function (a, b) { var obj = function (a, b) {
return a + b; return a + b;
}; };
obj[0] = 11; obj[0] = 11;
obj[1] = 9; obj[1] = 9;
assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)'); 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. // 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 es5id: 15.4.4.16-2-1
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own data property own data property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { var obj = {
0: 12, 0: 12,
1: 11, 1: 11,
2: 9, 2: 9,
length: 2 length: 2
}; };
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-10
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
inherited accessor property inherited accessor property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { }; var proto = { };
Object.defineProperty(proto, "length", { Object.defineProperty(proto, "length", {
get: function () { get: function () {
return 2; return 2;
}, },
configurable: true configurable: true
}); });
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
child[0] = 12; child[0] = 12;
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-11
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own accessor property without a get function own accessor property without a get function
---*/ ---*/
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return val > 10; return val > 10;
} }
var obj = { var obj = {
0: 9, 0: 9,
1: 8 1: 8
}; };
Object.defineProperty(obj, "length", { Object.defineProperty(obj, "length", {
set: function () { }, set: function () { },
configurable: true configurable: true
}); });
assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed'); assert.sameValue(accessed, false, 'accessed');

View File

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

View File

@ -2,31 +2,32 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-2-13
description: > description: >
Array.prototype.every applied to the Array-like object that Array.prototype.every applied to the Array-like object that
'length' is inherited accessor property without a get function 'length' is inherited accessor property without a get function
---*/ ---*/
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return val > 10; return val > 10;
} }
var proto = {}; var proto = {};
Object.defineProperty(proto, "length", { Object.defineProperty(proto, "length", {
set: function () { }, set: function () { },
configurable: true configurable: true
}); });
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
child[0] = 9; child[0] = 9;
child[1] = 8; child[1] = 8;
assert(Array.prototype.every.call(child, callbackfn), 'Array.prototype.every.call(child, callbackfn) !== true'); assert(Array.prototype.every.call(child, callbackfn), 'Array.prototype.every.call(child, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed'); assert.sameValue(accessed, false, 'accessed');

View File

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

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-2-17
description: > description: >
Array.prototype.every applied to the Arguments object, which Array.prototype.every applied to the Arguments object, which
implements its own property get method implements its own property get method
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var func = function (a, b) { var func = function (a, b) {
arguments[2] = 9; arguments[2] = 9;
return Array.prototype.every.call(arguments, callbackfn1) && return Array.prototype.every.call(arguments, callbackfn1) &&
!Array.prototype.every.call(arguments, callbackfn2); !Array.prototype.every.call(arguments, callbackfn2);
}; };
assert(func(12, 11), 'func(12, 11) !== true'); 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. // 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 es5id: 15.4.4.16-2-18
description: > description: >
Array.prototype.every applied to String object, which implements Array.prototype.every applied to String object, which implements
its own property get method its own property get method
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return parseInt(val, 10) > 1; return parseInt(val, 10) > 1;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return parseInt(val, 10) > 2; 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(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)'); 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. // 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 es5id: 15.4.4.16-2-19
description: > description: >
Array.prototype.every applied to Function object, which implements Array.prototype.every applied to Function object, which implements
its own property get method its own property get method
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var fun = function (a, b) { var fun = function (a, b) {
return a + b; return a + b;
}; };
fun[0] = 12; fun[0] = 12;
fun[1] = 11; fun[1] = 11;
fun[2] = 9; fun[2] = 9;
assert(Array.prototype.every.call(fun, callbackfn1), 'Array.prototype.every.call(fun, callbackfn1) !== true'); 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)'); 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. // 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 es5id: 15.4.4.16-2-2
description: Array.prototype.every - 'length' is own data property on an Array description: Array.prototype.every - 'length' is own data property on an Array
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
Array.prototype[2] = 9; Array.prototype[2] = 9;
assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true'); assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true');
assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)'); 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. // 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 es5id: 15.4.4.16-2-3
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own data property that overrides an inherited data property own data property that overrides an inherited data property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { length: 3 }; var proto = { length: 3 };
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
child.length = 2; child.length = 2;
child[0] = 12; child[0] = 12;
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-4
description: > description: >
Array.prototype.every - 'length' is own data property that Array.prototype.every - 'length' is own data property that
overrides an inherited data property on an Array overrides an inherited data property on an Array
---*/ ---*/
var arrProtoLen = 0; var arrProtoLen = 0;
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
arrProtoLen = Array.prototype.length; arrProtoLen = Array.prototype.length;
Array.prototype.length = 0; Array.prototype.length = 0;
Array.prototype[2] = 9; Array.prototype[2] = 9;
assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true'); assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true');
assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)'); 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. // 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 es5id: 15.4.4.16-2-5
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own data property that overrides an inherited accessor property own data property that overrides an inherited accessor property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { }; var proto = { };
Object.defineProperty(proto, "length", { Object.defineProperty(proto, "length", {
get: function () { get: function () {
return 3; return 3;
}, },
configurable: true configurable: true
}); });
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
child[0] = 12; child[0] = 12;
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
Object.defineProperty(child, "length", { Object.defineProperty(child, "length", {
value: 2, value: 2,
configurable: true configurable: true
}); });
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-6
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
inherited data property inherited data property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { length: 2 }; var proto = { length: 2 };
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
child[0] = 12; child[0] = 12;
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-7
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own accessor property own accessor property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var obj = { }; var obj = { };
Object.defineProperty(obj, "length", { Object.defineProperty(obj, "length", {
get: function () { get: function () {
return 2; return 2;
}, },
configurable: true configurable: true
}); });
obj[0] = 12; obj[0] = 12;
obj[1] = 11; obj[1] = 11;
obj[2] = 9; obj[2] = 9;
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-8
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own accessor property that overrides an inherited data property own accessor property that overrides an inherited data property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = { length: 3 }; var proto = { length: 3 };
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
Object.defineProperty(child, "length", { Object.defineProperty(child, "length", {
get: function () { get: function () {
return 2; return 2;
}, },
configurable: true configurable: true
}); });
child[0] = 12; child[0] = 12;
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-2-9
description: > description: >
Array.prototype.every applied to Array-like object, 'length' is an Array.prototype.every applied to Array-like object, 'length' is an
own accessor property that overrides an inherited accessor property own accessor property that overrides an inherited accessor property
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var proto = {}; var proto = {};
Object.defineProperty(proto, "length", { Object.defineProperty(proto, "length", {
get: function () { get: function () {
return 3; return 3;
}, },
configurable: true configurable: true
}); });
var Con = function () { }; var Con = function () { };
Con.prototype = proto; Con.prototype = proto;
var child = new Con(); var child = new Con();
Object.defineProperty(child, "length", { Object.defineProperty(child, "length", {
get: function () { get: function () {
return 2; return 2;
}, },
configurable: true configurable: true
}); });
child[0] = 12; child[0] = 12;
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
assert(Array.prototype.every.call(child, callbackfn1), 'Array.prototype.every.call(child, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-3-1
description: Array.prototype.every - value of 'length' is undefined description: Array.prototype.every - value of 'length' is undefined
---*/ ---*/
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return val > 10; 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(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed'); assert.sameValue(accessed, false, 'accessed');

View File

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

View File

@ -2,21 +2,22 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-3-11
description: > description: >
Array.prototype.every - 'length' is a string containing a positive Array.prototype.every - 'length' is a string containing a positive
number number
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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(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.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. // 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 es5id: 15.4.4.16-3-12
description: > description: >
Array.prototype.every - 'length' is a string containing a negative Array.prototype.every - 'length' is a string containing a negative
number number
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== true');
assert(Array.prototype.every.call(obj, callbackfn2), 'Array.prototype.every.call(obj, callbackfn2) !== 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. // 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 es5id: 15.4.4.16-3-13
description: > description: >
Array.prototype.every - 'length' is a string containing a decimal Array.prototype.every - 'length' is a string containing a decimal
number number
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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(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.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. // 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 es5id: 15.4.4.16-3-14
description: Array.prototype.every - 'length' is a string containing +/-Infinity description: Array.prototype.every - 'length' is a string containing +/-Infinity
---*/ ---*/
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return val > 10; return val > 10;
} }
var objOne = { 0: 9, length: "Infinity" }; var objOne = { 0: 9, length: "Infinity" };
var objTwo = { 0: 9, length: "+Infinity" }; var objTwo = { 0: 9, length: "+Infinity" };
var objThree = { 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(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.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. // 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 es5id: 15.4.4.16-3-15
description: > description: >
Array.prototype.every - 'length' is a string containing an Array.prototype.every - 'length' is a string containing an
exponential number exponential number
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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(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.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. // 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 es5id: 15.4.4.16-3-16
description: > description: >
Array.prototype.every - 'length' is a string containing a hex Array.prototype.every - 'length' is a string containing a hex
number number
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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(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.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. // 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 es5id: 15.4.4.16-3-17
description: > description: >
Array.prototype.every - 'length' is a string containing a number Array.prototype.every - 'length' is a string containing a number
with leading zeros with leading zeros
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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(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.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. // 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 es5id: 15.4.4.16-3-18
description: > description: >
Array.prototype.every - value of 'length' is a string that can't Array.prototype.every - value of 'length' is a string that can't
convert to a number convert to a number
---*/ ---*/
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return val > 10; 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(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true');
assert.sameValue(accessed, false, 'accessed'); assert.sameValue(accessed, false, 'accessed');

View File

@ -2,39 +2,40 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-3-19
description: > description: >
Array.prototype.every - value of 'length' is an Object which has Array.prototype.every - value of 'length' is an Object which has
an own toString method an own toString method
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; 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) { // objects inherit the default valueOf() method from Object
return val > 11; // 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
var toStringAccessed = false; // resulting string to a number.
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.
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-3-2
description: > description: >
Array.prototype.every on an Array-like object if 'length' is 1 Array.prototype.every on an Array-like object if 'length' is 1
(length overridden to true(type conversion)) (length overridden to true(type conversion))
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; 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(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.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. // 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 es5id: 15.4.4.16-3-20
description: > description: >
Array.prototype.every - value of 'length' is an Object which has Array.prototype.every - value of 'length' is an Object which has
an own valueOf method an own valueOf method
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; return val > 10;
} }
function callbackfn2(val, idx, obj) { function callbackfn2(val, idx, obj) {
return val > 11; return val > 11;
} }
var valueOfAccessed = false; var valueOfAccessed = false;
var obj = { var obj = {
0: 12, 0: 12,
1: 11, 1: 11,
2: 9, 2: 9,
length: { length: {
valueOf: function () { valueOf: function () {
valueOfAccessed = true; valueOfAccessed = true;
return 2; return 2;
} }
} }
}; };
assert(Array.prototype.every.call(obj, callbackfn1), 'Array.prototype.every.call(obj, callbackfn1) !== 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)'); 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. // 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 es5id: 15.4.4.16-3-21
description: > description: >
Array.prototype.every - 'length' is an object that has an own Array.prototype.every - 'length' is an object that has an own
@ -9,32 +10,32 @@ description: >
returns a string returns a string
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
return val > 10; 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(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.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. // 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 es5id: 15.4.4.16-3-22
description: > description: >
Array.prototype.every throws TypeError exception when 'length' is 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. // 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 es5id: 15.4.4.16-3-23
description: > description: >
Array.prototype.every uses inherited valueOf method when 'length' 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. // 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 es5id: 15.4.4.16-3-24
description: > description: >
Array.prototype.every - value of 'length' is a positive 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. // 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 es5id: 15.4.4.16-3-25
description: Array.prototype.every - value of 'length' is a negative non-integer 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. // 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 es5id: 15.4.4.16-3-29
description: > description: >
Array.prototype.every - value of 'length' is boundary value (2^32 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. // 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 es5id: 15.4.4.16-3-3
description: Array.prototype.every - value of 'length' is a number (value is 0) 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. // 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 es5id: 15.4.4.16-3-4
description: Array.prototype.every - value of 'length' is a number (value is +0) 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. // 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 es5id: 15.4.4.16-3-5
description: Array.prototype.every - value of 'length' is a number (value is -0) 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. // 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 es5id: 15.4.4.16-3-6
description: > description: >
Array.prototype.every - value of 'length' is a number (value is 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. // 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 es5id: 15.4.4.16-3-7
description: > description: >
Array.prototype.every - value of 'length' is a number (value is 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. // 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 es5id: 15.4.4.16-3-8
description: > description: >
Array.prototype.every - value of 'length' is a number (value is 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. // 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 es5id: 15.4.4.16-3-9
description: > description: >
Array.prototype.every - value of 'length' is a number (value is 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. // 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 es5id: 15.4.4.16-4-1
description: Array.prototype.every throws TypeError if callbackfn is undefined 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. // 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 es5id: 15.4.4.16-4-10
description: > description: >
Array.prototype.every - the exception is not thrown if exception 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. // 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 es5id: 15.4.4.16-4-11
description: > description: >
Array.prototype.every - the exception is not thrown if exception 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. // 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 es5id: 15.4.4.16-4-12
description: Array.prototype.every - 'callbackfn' is a function 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. // 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 es5id: 15.4.4.16-4-15
description: > description: >
Array.prototype.every - calling with no callbackfn is the same as 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. // 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 es5id: 15.4.4.16-4-3
description: Array.prototype.every throws TypeError if callbackfn is null 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. // 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 es5id: 15.4.4.16-4-4
description: Array.prototype.every throws TypeError if callbackfn is boolean 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. // 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 es5id: 15.4.4.16-4-5
description: Array.prototype.every throws TypeError if callbackfn is number 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. // 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 es5id: 15.4.4.16-4-6
description: Array.prototype.every throws TypeError if callbackfn is string 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. // 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 es5id: 15.4.4.16-4-7
description: > description: >
Array.prototype.every throws TypeError if callbackfn is Object 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. // 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 es5id: 15.4.4.16-4-8
description: > description: >
Array.prototype.every - side effects produced by step 2 are 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. // 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 es5id: 15.4.4.16-4-9
description: > description: >
Array.prototype.every - side effects produced by step 3 are 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. // 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 es5id: 15.4.4.16-5-1-s
description: Array.prototype.every - thisArg not passed to strict callbackfn description: Array.prototype.every - thisArg not passed to strict callbackfn
flags: [noStrict] flags: [noStrict]

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-5-1
description: Array.prototype.every - thisArg not passed description: Array.prototype.every - thisArg not passed
flags: [noStrict] flags: [noStrict]

View File

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

View File

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

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-5-13
description: Array.prototype.every - Number Object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-14
description: Array.prototype.every - the Math object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-15
description: Array.prototype.every - Date Object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-16
description: Array.prototype.every - RegExp Object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-17
description: Array.prototype.every - the JSON object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-18
description: Array.prototype.every - Error Object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-19
description: Array.prototype.every - the Arguments object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-2
description: Array.prototype.every - thisArg is Object 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. // 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 es5id: 15.4.4.16-5-21
description: Array.prototype.every - the global object can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-22
description: Array.prototype.every - boolean primitive can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-23
description: Array.prototype.every - number primitive can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-24
description: Array.prototype.every - string primitive can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-3
description: Array.prototype.every - thisArg is Array 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. // 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 es5id: 15.4.4.16-5-4
description: > description: >
Array.prototype.every - thisArg is object from object Array.prototype.every - thisArg is object from object
@ -13,7 +14,7 @@ description: >
{ {
return this.res; return this.res;
} }
function foo(){} function foo(){}
foo.prototype.res = true; foo.prototype.res = true;
var f = new foo(); var f = new foo();

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-5-5
description: Array.prototype.every - thisArg is object from object template 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. // 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 es5id: 15.4.4.16-5-6
description: Array.prototype.every - thisArg is function 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. // 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 es5id: 15.4.4.16-5-7
description: Array.prototype.every - built-in functions can be used as thisArg 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. // 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 es5id: 15.4.4.16-5-9
description: Array.prototype.every - Function Object can be used as thisArg 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. // 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 es5id: 15.4.4.16-7-1
description: > description: >
Array.prototype.every considers new elements added to array after Array.prototype.every considers new elements added to array after
@ -19,7 +20,7 @@ description: >
} }
var arr = [1,2,,4,5]; var arr = [1,2,,4,5];
var res = arr.every(callbackfn); var res = arr.every(callbackfn);
assert(calledForThree, 'calledForThree !== true'); assert(calledForThree, 'calledForThree !== true');

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // 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 es5id: 15.4.4.16-7-2
description: > description: >
Array.prototype.every considers new value of elements in array Array.prototype.every considers new value of elements in array
@ -13,11 +14,11 @@ description: >
arr[4] = 6; arr[4] = 6;
if(val < 6) if(val < 6)
return true; return true;
else else
return false; return false;
} }
var arr = [1,2,3,4,5]; var arr = [1,2,3,4,5];
assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); 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. // 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 es5id: 15.4.4.16-7-3
description: > description: >
Array.prototype.every doesn't visit deleted elements in array Array.prototype.every doesn't visit deleted elements in array
@ -13,11 +14,11 @@ description: >
delete arr[2]; delete arr[2];
if(val == 3) if(val == 3)
return false; return false;
else else
return true; return true;
} }
var arr = [1,2,3,4,5]; var arr = [1,2,3,4,5];
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); 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. // 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 es5id: 15.4.4.16-7-4
description: > description: >
Array.prototype.every doesn't visit deleted elements when Array.prototype.every doesn't visit deleted elements when
@ -13,11 +14,11 @@ description: >
arr.length = 3; arr.length = 3;
if(val < 4) if(val < 4)
return true; return true;
else else
return false; return false;
} }
var arr = [1,2,3,4,6]; var arr = [1,2,3,4,6];
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); 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. // 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 es5id: 15.4.4.16-7-5
description: > description: >
Array.prototype.every doesn't consider newly added elements in Array.prototype.every doesn't consider newly added elements in
@ -13,13 +14,13 @@ description: >
arr[1000] = 3; arr[1000] = 3;
if(val < 3) if(val < 3)
return true; return true;
else else
return false; return false;
} }
var arr = new Array(10); var arr = new Array(10);
arr[1] = 1; arr[1] = 1;
arr[2] = 2; arr[2] = 2;
assert.sameValue(arr.every(callbackfn), true, 'arr.every(callbackfn)'); 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. // 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 es5id: 15.4.4.16-7-6
description: > description: >
Array.prototype.every visits deleted element in array after the Array.prototype.every visits deleted element in array after the
@ -13,13 +14,13 @@ description: >
delete arr[2]; delete arr[2];
if(val == 3) if(val == 3)
return false; return false;
else else
return true; return true;
} }
Array.prototype[2] = 3; Array.prototype[2] = 3;
var arr = [1,2,3,4,5]; var arr = [1,2,3,4,5];
var res = arr.every(callbackfn); var res = arr.every(callbackfn);
delete Array.prototype[2]; delete Array.prototype[2];

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