add esid to array/prototype/toString tests

This commit is contained in:
deathbearbrown 2017-06-30 14:24:07 -07:00 committed by Rick Waldron
parent 20b8c9b896
commit 2d13a07cc1
7 changed files with 19 additions and 12 deletions

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
info: >
The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument
@ -16,8 +17,8 @@ if (x.toString() !== x.join()) {
} else {
if (x.toString() !== "") {
$ERROR('#1.2: x = new Array(); x.toString() === "". Actual: ' + (x.toString()));
}
}
}
}
//CHECK#2
x = [];
@ -28,5 +29,5 @@ if (x.toString() !== x.join()) {
} else {
if (x.toString() !== "") {
$ERROR('#2.2: x = []; x[0] = 1; x.length = 0; x.toString() === "". Actual: ' + (x.toString()));
}
}
}

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
info: >
The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
info: >
The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument
@ -26,7 +27,7 @@ if (x.toString() !== x.join()) {
} else {
if (x.toString() !== "\\,\\,\\") {
$ERROR('#1.2: var x = new Array("\\","\\","\\"); x.toString() === "\\,\\,\\". Actual: ' + (x.toString()));
}
}
}
//CHECK#2

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
info: >
The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument
@ -28,8 +29,8 @@ if (x.toString() !== x.join()) {
} else {
if (x.toString() !== "*") {
$ERROR('#2.2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString()));
}
}
}
}
//CHECK#3
var object = {valueOf: function() {return "+"}, toString: function() {return {}}};
@ -90,11 +91,11 @@ try {
var x = new Array(object);
x.toString();
$ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.toString() throw "error". Actual: ' + (x.toString()));
}
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.toString() throw "error". Actual: ' + (e));
}
}
}
//CHECK#8
@ -103,9 +104,9 @@ try {
var x = new Array(object);
x.toString();
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.toString() throw TypeError. Actual: ' + (x.toString()));
}
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.toString() throw TypeError. Actual: ' + (e));
}
}
}

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
info: "[[Get]] from not an inherited property"
es5id: 15.4.4.2_A3_T1
description: "[[Prototype]] of Array instance is Array.prototype"
@ -11,6 +12,6 @@ description: "[[Prototype]] of Array instance is Array.prototype"
Array.prototype[1] = 1;
var x = [0];
x.length = 2;
if (x.toString() !== "0,1") {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.toString() === "0,1". Actual: ' + (x.toString()));
if (x.toString() !== "0,1") {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.toString() === "0,1". Actual: ' + (x.toString()));
}

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
info: The toString property of Array can't be used as constructor
es5id: 15.4.4.2_A4.7
description: >

View File

@ -2,6 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.tostring
es6id: 22.1.3.27
description: >
Array.prototype.toString.name is "toString".