add esid to array/prototype/join (#1111)

This commit is contained in:
Sue Lockwood 2017-06-30 07:42:18 -07:00 committed by Leo Balter
parent 54e6302219
commit 4fe640b297
17 changed files with 50 additions and 33 deletions

View File

@ -3,6 +3,7 @@
/*--- /*---
info: If length is zero, return the empty string info: If length is zero, return the empty string
esid: sec-array.prototype.join
es5id: 15.4.4.5_A1.1_T1 es5id: 15.4.4.5_A1.1_T1
description: Checking this use new Array() and [] description: Checking this use new Array() and []
---*/ ---*/
@ -11,7 +12,7 @@ description: Checking this use new Array() and []
var x = new Array(); var x = new Array();
if (x.join() !== "") { if (x.join() !== "") {
$ERROR('#1: x = new Array(); x.join() === "". Actual: ' + (x.join())); $ERROR('#1: x = new Array(); x.join() === "". Actual: ' + (x.join()));
} }
//CHECK#2 //CHECK#2
x = []; x = [];

View File

@ -3,6 +3,7 @@
/*--- /*---
info: If separator is undefined, a single comma is used as the separator info: If separator is undefined, a single comma is used as the separator
esid: sec-array.prototype.join
es5id: 15.4.4.5_A1.2_T1 es5id: 15.4.4.5_A1.2_T1
description: Checking this use new Array() and [] description: Checking this use new Array() and []
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: If separator is undefined, a single comma is used as the separator info: If separator is undefined, a single comma is used as the separator
esid: sec-array.prototype.join
es5id: 15.4.4.5_A1.2_T2 es5id: 15.4.4.5_A1.2_T2
description: Checking this use new Array() and [] description: Checking this use new Array() and []
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: If array element is undefined or null, use the empty string info: If array element is undefined or null, use the empty string
esid: sec-array.prototype.join
es5id: 15.4.4.5_A1.3_T1 es5id: 15.4.4.5_A1.3_T1
description: Checking this use new Array() and [] description: Checking this use new Array() and []
---*/ ---*/

View File

@ -5,6 +5,7 @@
info: > info: >
The join function is intentionally generic. The join function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.join
es5id: 15.4.4.5_A2_T1 es5id: 15.4.4.5_A2_T1
description: If ToUint32(length) is zero, return the empty string description: If ToUint32(length) is zero, return the empty string
---*/ ---*/
@ -15,7 +16,7 @@ obj.join = Array.prototype.join;
if (obj.length !== undefined) { if (obj.length !== undefined) {
$ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length));
} else { } else {
//CHECK#1 //CHECK#1
if (obj.join() !== "") { if (obj.join() !== "") {
$ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
} }
@ -23,13 +24,13 @@ if (obj.length !== undefined) {
if (obj.length !== undefined) { if (obj.length !== undefined) {
$ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length)); $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length));
} }
} }
//CHECK#3 //CHECK#3
obj.length = undefined; obj.length = undefined;
if (obj.join() !== "") { if (obj.join() !== "") {
$ERROR('#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === ". Actual: ' + (obj.join())); $ERROR('#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === ". Actual: ' + (obj.join()));
} }
//CHECK#4 //CHECK#4
if (obj.length !== undefined) { if (obj.length !== undefined) {
@ -40,7 +41,7 @@ if (obj.length !== undefined) {
obj.length = null obj.length = null
if (obj.join() !== "") { if (obj.join() !== "") {
$ERROR('#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); $ERROR('#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
} }
//CHECK#6 //CHECK#6
if (obj.length !== null) { if (obj.length !== null) {

View File

@ -5,6 +5,7 @@
info: > info: >
The join function is intentionally generic. The join function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.join
es5id: 15.4.4.5_A2_T2 es5id: 15.4.4.5_A2_T2
description: If ToUint32(length) is zero, return the empty string description: If ToUint32(length) is zero, return the empty string
---*/ ---*/
@ -36,7 +37,7 @@ if (obj.length !== Number.NEGATIVE_INFINITY) {
obj.length = -0; obj.length = -0;
if (obj.join() !== "") { if (obj.join() !== "") {
$ERROR('#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); $ERROR('#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
} }
//CHECK#8 //CHECK#8
if (obj.length !== -0) { if (obj.length !== -0) {
@ -44,8 +45,8 @@ if (obj.length !== -0) {
} else { } else {
if (1/obj.length !== Number.NEGATIVE_INFINITY) { if (1/obj.length !== Number.NEGATIVE_INFINITY) {
$ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === -0. Actual: ' + (obj.length)); $ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === -0. Actual: ' + (obj.length));
} }
} }
//CHECK#9 //CHECK#9
obj.length = 0.5; obj.length = 0.5;
@ -56,7 +57,7 @@ if (obj.join() !== "") {
//CHECK#10 //CHECK#10
if (obj.length !== 0.5) { if (obj.length !== 0.5) {
$ERROR('#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5. Actual: ' + (obj.length)); $ERROR('#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5. Actual: ' + (obj.length));
} }
//CHECK#11 //CHECK#11
var x = new Number(0); var x = new Number(0);

View File

@ -5,6 +5,7 @@
info: > info: >
The join function is intentionally generic. The join function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.join
es5id: 15.4.4.5_A2_T3 es5id: 15.4.4.5_A2_T3
description: If ToUint32(length) is zero, return the empty string description: If ToUint32(length) is zero, return the empty string
---*/ ---*/
@ -29,7 +30,7 @@ if (obj.join() !== ",1,,") {
//CHECK#3 //CHECK#3
if (obj.length !== 4.5) { if (obj.length !== 4.5) {
$ERROR('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5. Actual: ' + (obj.length)); $ERROR('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5. Actual: ' + (obj.length));
} }
var obj = {}; var obj = {};
obj.join = Array.prototype.join; obj.join = Array.prototype.join;

View File

@ -5,6 +5,7 @@
info: > info: >
The join function is intentionally generic. The join function is intentionally generic.
It does not require that its this value be an Array object It does not require that its this value be an Array object
esid: sec-array.prototype.join
es5id: 15.4.4.5_A2_T4 es5id: 15.4.4.5_A2_T4
description: > description: >
Operator use ToNumber from length. If Type(value) is Object, Operator use ToNumber from length. If Type(value) is Object,
@ -24,7 +25,7 @@ if (obj.join() !== ",,") {
obj.length = {valueOf: function() {return 3}, toString: function() {return 2}}; obj.length = {valueOf: function() {return 3}, toString: function() {return 2}};
if (obj.join() !== ",,") { if (obj.join() !== ",,") {
$ERROR('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join())); $ERROR('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join()));
} }
//CHECK#3 //CHECK#3
obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; obj.length = {valueOf: function() {return 3}, toString: function() {return {}}};
@ -33,8 +34,8 @@ if (obj.join() !== ",,") {
} }
//CHECK#4 //CHECK#4
try { try {
obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}};
if (obj.join() !== ",,") { if (obj.join() !== ",,") {
$ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() === ",". Actual: ' + (obj.join())); $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() === ",". Actual: ' + (obj.join()));
} }
@ -61,14 +62,14 @@ if (obj.join() !== ",") {
//CHECK#7 //CHECK#7
try { try {
obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}};
obj.join(); obj.join();
$ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (obj.join())); $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (obj.join()));
} }
catch (e) { catch (e) {
if (e !== "error") { if (e !== "error") {
$ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (e)); $ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (e));
} }
} }
//CHECK#8 //CHECK#8
@ -76,9 +77,9 @@ try {
obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}};
obj.join(); obj.join();
$ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (obj.join())); $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (obj.join()));
} }
catch (e) { catch (e) {
if ((e instanceof TypeError) !== true) { if ((e instanceof TypeError) !== true) {
$ERROR('#8,2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (e)); $ERROR('#8,2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (e));
} }
} }

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToString from separator info: Operator use ToString from separator
esid: sec-array.prototype.join
es5id: 15.4.4.5_A3.1_T1 es5id: 15.4.4.5_A3.1_T1
description: > description: >
Checking separator in ["", "\\", "&", true, Infinity, null, Checking separator in ["", "\\", "&", true, Infinity, null,

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToString from separator info: Operator use ToString from separator
esid: sec-array.prototype.join
es5id: 15.4.4.5_A3.1_T2 es5id: 15.4.4.5_A3.1_T2
description: > description: >
If Type(separator) is Object, evaluate ToPrimitive(separator, If Type(separator) is Object, evaluate ToPrimitive(separator,
@ -20,7 +21,7 @@ if (x.join(object) !== "0[object Object]1[object Object]2[object Object]3") {
var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; var object = {valueOf: function() {return "+"}, toString: function() {return "*"}};
if (x.join(object) !== "0*1*2*3") { if (x.join(object) !== "0*1*2*3") {
$ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); $ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object)));
} }
//CHECK#3 //CHECK#3
var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; var object = {valueOf: function() {return "+"}, toString: function() {return {}}};
@ -60,11 +61,11 @@ try {
var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}};
x.join(object); x.join(object);
$ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object))); $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object)));
} }
catch (e) { catch (e) {
if (e !== "error") { if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (e)); $ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (e));
} }
} }
//CHECK#8 //CHECK#8
@ -72,11 +73,11 @@ try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}}; var object = {valueOf: function() {return {}}, toString: function() {return {}}};
x.join(object); x.join(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object))); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object)));
} }
catch (e) { catch (e) {
if ((e instanceof TypeError) !== true) { if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (e)); $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (e));
} }
} }
//CHECK#9 //CHECK#9

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToString from array arguments info: Operator use ToString from array arguments
esid: sec-array.prototype.join
es5id: 15.4.4.5_A3.2_T1 es5id: 15.4.4.5_A3.2_T1
description: > description: >
Checking arguments and separator in ["", "\\", "&", true, Checking arguments and separator in ["", "\\", "&", true,

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Operator use ToString from array arguments info: Operator use ToString from array arguments
esid: sec-array.prototype.join
es5id: 15.4.4.5_A3.2_T2 es5id: 15.4.4.5_A3.2_T2
description: If Type(argument) is Object, evaluate ToPrimitive(argument, String) description: If Type(argument) is Object, evaluate ToPrimitive(argument, String)
---*/ ---*/
@ -19,7 +20,7 @@ var object = {valueOf: function() {return "+"}, toString: function() {return "*"
var x = new Array(object); var x = new Array(object);
if (x.join() !== "*") { if (x.join() !== "*") {
$ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); $ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join()));
} }
//CHECK#3 //CHECK#3
var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; var object = {valueOf: function() {return "+"}, toString: function() {return {}}};
@ -64,11 +65,11 @@ try {
var x = new Array(object); var x = new Array(object);
x.join(); x.join();
$ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (x.join())); $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (x.join()));
} }
catch (e) { catch (e) {
if (e !== "error") { if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (e)); $ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (e));
} }
} }
//CHECK#8 //CHECK#8
@ -77,9 +78,9 @@ try {
var x = new Array(object); var x = new Array(object);
x.join(); x.join();
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (x.join())); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (x.join()));
} }
catch (e) { catch (e) {
if ((e instanceof TypeError) !== true) { if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (e)); $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (e));
} }
} }

View File

@ -3,6 +3,7 @@
/*--- /*---
info: Check ToLength(length) for non Array objects info: Check ToLength(length) for non Array objects
esid: sec-array.prototype.join
es5id: 15.4.4.5_A4_T3 es5id: 15.4.4.5_A4_T3
description: length = -4294967294 description: length = -4294967294
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: "[[Get]] from not an inherited property" info: "[[Get]] from not an inherited property"
esid: sec-array.prototype.join
es5id: 15.4.4.5_A5_T1 es5id: 15.4.4.5_A5_T1
description: > description: >
[[Prototype]] of Array instance is Array.prototype, [[Prototype] [[Prototype]] of Array instance is Array.prototype, [[Prototype]
@ -13,8 +14,8 @@ description: >
Array.prototype[1] = 1; Array.prototype[1] = 1;
var x = [0]; var x = [0];
x.length = 2; x.length = 2;
if (x.join() !== "0,1") { if (x.join() !== "0,1") {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join())); $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join()));
} }
//CHECK#2 //CHECK#2
@ -22,6 +23,6 @@ Object.prototype[1] = 1;
Object.prototype.length = 2; Object.prototype.length = 2;
Object.prototype.join = Array.prototype.join; Object.prototype.join = Array.prototype.join;
x = {0:0}; x = {0:0};
if (x.join() !== "0,1") { if (x.join() !== "0,1") {
$ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join())); $ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join()));
} }

View File

@ -3,6 +3,7 @@
/*--- /*---
info: The join property of Array has not prototype property info: The join property of Array has not prototype property
esid: sec-array.prototype.join
es5id: 15.4.4.5_A6.6 es5id: 15.4.4.5_A6.6
description: Checking Array.prototype.join.prototype description: Checking Array.prototype.join.prototype
---*/ ---*/

View File

@ -3,6 +3,7 @@
/*--- /*---
info: The join property of Array can't be used as constructor info: The join property of Array can't be used as constructor
esid: sec-array.prototype.join
es5id: 15.4.4.5_A6.7 es5id: 15.4.4.5_A6.7
description: > description: >
If property does not implement the internal [[Construct]] method, If property does not implement the internal [[Construct]] method,

View File

@ -2,7 +2,8 @@
// 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.
/*--- /*---
es6id: 22.1.3.12 esid: sec-array.prototype.join
es6id: 22.1.3.13
description: > description: >
Array.prototype.join.name is "join". Array.prototype.join.name is "join".
info: > info: >