Skip to content
Snippets Groups Projects
Commit 2d13a07c authored by deathbearbrown's avatar deathbearbrown Committed by Rick Waldron
Browse files

add esid to array/prototype/toString tests

parent 20b8c9b8
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
info: > info: >
The result of calling this function is the same as if The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument the built-in join method were invoked for this object with no argument
...@@ -16,8 +17,8 @@ if (x.toString() !== x.join()) { ...@@ -16,8 +17,8 @@ if (x.toString() !== x.join()) {
} else { } else {
if (x.toString() !== "") { if (x.toString() !== "") {
$ERROR('#1.2: x = new Array(); x.toString() === "". Actual: ' + (x.toString())); $ERROR('#1.2: x = new Array(); x.toString() === "". Actual: ' + (x.toString()));
} }
} }
//CHECK#2 //CHECK#2
x = []; x = [];
...@@ -28,5 +29,5 @@ if (x.toString() !== x.join()) { ...@@ -28,5 +29,5 @@ if (x.toString() !== x.join()) {
} else { } else {
if (x.toString() !== "") { if (x.toString() !== "") {
$ERROR('#2.2: x = []; x[0] = 1; x.length = 0; x.toString() === "". Actual: ' + (x.toString())); $ERROR('#2.2: x = []; x[0] = 1; x.length = 0; x.toString() === "". Actual: ' + (x.toString()));
} }
} }
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
info: > info: >
The result of calling this function is the same as if The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument the built-in join method were invoked for this object with no argument
......
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
info: > info: >
The result of calling this function is the same as if The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument the built-in join method were invoked for this object with no argument
...@@ -26,7 +27,7 @@ if (x.toString() !== x.join()) { ...@@ -26,7 +27,7 @@ if (x.toString() !== x.join()) {
} else { } else {
if (x.toString() !== "\\,\\,\\") { if (x.toString() !== "\\,\\,\\") {
$ERROR('#1.2: var x = new Array("\\","\\","\\"); x.toString() === "\\,\\,\\". Actual: ' + (x.toString())); $ERROR('#1.2: var x = new Array("\\","\\","\\"); x.toString() === "\\,\\,\\". Actual: ' + (x.toString()));
} }
} }
//CHECK#2 //CHECK#2
......
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
info: > info: >
The result of calling this function is the same as if The result of calling this function is the same as if
the built-in join method were invoked for this object with no argument the built-in join method were invoked for this object with no argument
...@@ -28,8 +29,8 @@ if (x.toString() !== x.join()) { ...@@ -28,8 +29,8 @@ if (x.toString() !== x.join()) {
} else { } else {
if (x.toString() !== "*") { if (x.toString() !== "*") {
$ERROR('#2.2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.toString() === "*". Actual: ' + (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 //CHECK#3
var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; var object = {valueOf: function() {return "+"}, toString: function() {return {}}};
...@@ -90,11 +91,11 @@ try { ...@@ -90,11 +91,11 @@ try {
var x = new Array(object); var x = new Array(object);
x.toString(); 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())); $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) { 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.toString() throw "error". Actual: ' + (e)); $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 //CHECK#8
...@@ -103,9 +104,9 @@ try { ...@@ -103,9 +104,9 @@ try {
var x = new Array(object); var x = new Array(object);
x.toString(); 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())); $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) { 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.toString() throw TypeError. Actual: ' + (e)); $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.toString() throw TypeError. Actual: ' + (e));
} }
} }
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
info: "[[Get]] from not an inherited property" info: "[[Get]] from not an inherited property"
es5id: 15.4.4.2_A3_T1 es5id: 15.4.4.2_A3_T1
description: "[[Prototype]] of Array instance is Array.prototype" description: "[[Prototype]] of Array instance is Array.prototype"
...@@ -11,6 +12,6 @@ description: "[[Prototype]] of Array instance is Array.prototype" ...@@ -11,6 +12,6 @@ description: "[[Prototype]] of Array instance is Array.prototype"
Array.prototype[1] = 1; Array.prototype[1] = 1;
var x = [0]; var x = [0];
x.length = 2; x.length = 2;
if (x.toString() !== "0,1") { if (x.toString() !== "0,1") {
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.toString() === "0,1". Actual: ' + (x.toString())); $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.toString() === "0,1". Actual: ' + (x.toString()));
} }
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
info: The toString property of Array can't be used as constructor info: The toString property of Array can't be used as constructor
es5id: 15.4.4.2_A4.7 es5id: 15.4.4.2_A4.7
description: > description: >
......
...@@ -2,6 +2,7 @@ ...@@ -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.tostring
es6id: 22.1.3.27 es6id: 22.1.3.27
description: > description: >
Array.prototype.toString.name is "toString". Array.prototype.toString.name is "toString".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment