From 5ff655019781b3a6013a04c22e3d1ee861872c60 Mon Sep 17 00:00:00 2001 From: Sue Lockwood Date: Fri, 30 Jun 2017 07:42:59 -0700 Subject: [PATCH] add esid to array/prototype/push tests (#1116) --- .../Array/prototype/push/S15.4.4.7_A1_T1.js | 3 ++- .../Array/prototype/push/S15.4.4.7_A1_T2.js | 7 +++--- .../Array/prototype/push/S15.4.4.7_A2_T1.js | 9 ++++---- .../Array/prototype/push/S15.4.4.7_A2_T2.js | 5 ++-- .../Array/prototype/push/S15.4.4.7_A2_T3.js | 23 ++++++++++--------- .../Array/prototype/push/S15.4.4.7_A3.js | 1 + .../Array/prototype/push/S15.4.4.7_A4_T1.js | 9 ++++---- .../Array/prototype/push/S15.4.4.7_A4_T2.js | 3 ++- .../Array/prototype/push/S15.4.4.7_A4_T3.js | 5 ++-- .../Array/prototype/push/S15.4.4.7_A5_T1.js | 21 +++++++++-------- .../Array/prototype/push/S15.4.4.7_A6.7.js | 1 + test/built-ins/Array/prototype/push/name.js | 1 + 12 files changed, 50 insertions(+), 38 deletions(-) diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T1.js index 8646a84044..c33b955c3a 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T1.js @@ -6,6 +6,7 @@ info: > The arguments are appended to the end of the array, in the order in which they appear. The new length of the array is returned as the result of the call +esid: sec-array.prototype.push es5id: 15.4.4.7_A1_T1 description: Checking case when push is given no arguments or one argument ---*/ @@ -15,7 +16,7 @@ var x = new Array(); var push = x.push(1); if (push !== 1) { $ERROR('#1: x = new Array(); x.push(1) === 1. Actual: ' + (push)); -} +} //CHECK#2 if (x[0] !== 1) { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T2.js index 2310249841..1276fd818c 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T2.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A1_T2.js @@ -6,6 +6,7 @@ info: > The arguments are appended to the end of the array, in the order in which they appear. The new length of the array is returned as the result of the call +esid: sec-array.prototype.push es5id: 15.4.4.7_A1_T2 description: Checking case when push is given many arguments ---*/ @@ -21,7 +22,7 @@ x[0] = 0; var push = x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); if (push !== 6) { $ERROR('#2: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (push)); -} +} //CHECK#3 if (x[0] !== 0) { @@ -36,12 +37,12 @@ if (x[1] !== true) { //CHECK#5 if (x[2] !== Number.POSITIVE_INFINITY) { $ERROR('#5: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === Number.POSITIVE_INFINITY. Actual: ' + (x[2])); -} +} //CHECK#6 if (x[3] !== "NaN") { $ERROR('#6: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[3] === "NaN". Actual: ' + (x[3])); -} +} //CHECK#7 if (x[4] !== "1") { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js index cbc6c261c4..e4406ce93d 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T1.js @@ -5,6 +5,7 @@ info: > The push function is intentionally generic. It does not require that its this value be an Array object +esid: sec-array.prototype.push es5id: 15.4.4.7_A2_T1 description: > The arguments are appended to the end of the array, in the order @@ -18,7 +19,7 @@ obj.push = Array.prototype.push; if (obj.length !== undefined) { $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); } else { - //CHECK#1 + //CHECK#1 var push = obj.push(-1); if (push !== 1) { $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push)); @@ -31,14 +32,14 @@ if (push !== 1) { if (obj["0"] !== -1) { $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"])); } -} +} //CHECK#4 obj.length = undefined; var push = obj.push(-4); if (push !== 1) { $ERROR('#4: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4) === 1. Actual: ' + (push)); -} +} //CHECK#5 if (obj.length !== 1) { @@ -55,7 +56,7 @@ obj.length = null var push = obj.push(-7); if (push !== 1) { $ERROR('#7: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push)); -} +} //CHECK#8 if (obj.length !== 1) { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js index 3c185778bc..847d7931e6 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js @@ -5,6 +5,7 @@ info: > The push function is intentionally generic. It does not require that its this value be an Array object +esid: sec-array.prototype.push es5id: 15.4.4.7_A2_T2 description: > The arguments are appended to the end of the array, in the order @@ -73,7 +74,7 @@ if (push !== 1) { //CHECK#11 if (obj.length !== 1) { $ERROR('#11: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj.length === 1. Actual: ' + (obj.length)); -} +} //CHECK#12 if (obj["0"] !== -10) { @@ -90,7 +91,7 @@ if (push !== 2) { //CHECK#14 if (obj.length !== 2) { $ERROR('#14: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj.length === 2. Actual: ' + (obj.length)); -} +} //CHECK#15 if (obj["1"] !== -13) { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js index d9156f316a..fb992638e2 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A2_T3.js @@ -5,6 +5,7 @@ info: > The push function is intentionally generic. It does not require that its this value be an Array object +esid: sec-array.prototype.push es5id: 15.4.4.7_A2_T3 description: > Operator use ToNumber from length. If Type(value) is Object, @@ -26,7 +27,7 @@ obj.length = {valueOf: function() {return 3}, toString: function() {return 1}}; var push = obj.push(); if (push !== 3) { $ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.push() === 3. Actual: ' + (push)); -} +} //CHECK#3 obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; @@ -36,9 +37,9 @@ if (push !== 3) { } //CHECK#4 -try { - - obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; +try { + + obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; var push = obj.push(); if (push !== 3) { $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() === ",". Actual: ' + (push)); @@ -68,26 +69,26 @@ if (push !== 1) { //CHECK#7 try { - - obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + + obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; var push = obj.push(); $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (push)); -} +} catch (e) { if (e !== "error") { $ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (e)); - } + } } //CHECK#8 try { - + obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; var push = obj.push(); $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (push)); -} +} catch (e) { if ((e instanceof TypeError) !== true) { $ERROR('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (e)); - } + } } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js index d40582cd96..dd596aefd5 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A3.js @@ -3,6 +3,7 @@ /*--- info: Check ToLength(length) for Array object +esid: sec-array.prototype.push es5id: 15.4.4.7_A3 description: If ToUint32(length) !== length, throw RangeError ---*/ diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js index 08e6d0d42e..bc762776c5 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js @@ -3,6 +3,7 @@ /*--- info: Check ToLength(length) for non Array objects +esid: sec-array.prototype.push es5id: 15.4.4.7_A4_T1 description: length = 4294967296 ---*/ @@ -30,12 +31,12 @@ if (obj[0] !== undefined) { //CHECK#4 if (obj[1] !== undefined) { $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[1] === undefined. Actual: ' + (obj[1])); -} +} //CHECK#5 if (obj[2] !== undefined) { $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[2] === undefined. Actual: ' + (obj[2])); -} +} //CHECK#6 if (obj[4294967296] !== "x") { @@ -45,12 +46,12 @@ if (obj[4294967296] !== "x") { //CHECK#7 if (obj[4294967297] !== "y") { $ERROR('#7: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967297] === "y". Actual: ' + (obj[4294967297])); -} +} //CHECK#8 if (obj[4294967298] !== "z") { $ERROR('#8: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[4294967298] === "z". Actual: ' + (obj[4294967298])); -} +} var obj = {}; obj.push = Array.prototype.push; diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js index 605ef629ee..22a2c5b432 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js @@ -3,6 +3,7 @@ /*--- info: Check ToLength(length) for non Array objects +esid: sec-array.prototype.push es5id: 15.4.4.7_A4_T2 description: length = 4294967295 ---*/ @@ -30,7 +31,7 @@ if (obj[4294967295] !== "x") { //CHECK#4 if (obj[4294967296] !== "y") { $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); -} +} //CHECK#5 if (obj[4294967297] !== "z") { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js index b0862b55d7..464dcacca4 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A4_T3.js @@ -3,6 +3,7 @@ /*--- info: Check ToLength(length) for non Array objects +esid: sec-array.prototype.push es5id: 15.4.4.7_A4_T3 description: length = -1 ---*/ @@ -30,12 +31,12 @@ if (obj[4294967295] !== undefined) { //CHECK#4 if (obj[4294967296] !== undefined) { $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967296] === undefined. Actual: ' + (obj[4294967296])); -} +} //CHECK#5 if (obj[4294967297] !== undefined) { $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967297] === undefined. Actual: ' + (obj[4294967297])); -} +} //CHECK#6 if (obj[0] !== "x") { diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js index 8ab0e44ac2..6cbf65e074 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A5_T1.js @@ -3,6 +3,7 @@ /*--- info: "[[Get]] from not an inherited property" +esid: sec-array.prototype.push es5id: 15.4.4.7_A5_T1 description: > [[Prototype]] of Array instance is Array.prototype, [[Prototype] @@ -16,28 +17,28 @@ var x = {0:0}; //CHECK#1 var push = x.push(1); -if (push !== 2) { - $ERROR('#1: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1) === 2. Actual: ' + (push)); +if (push !== 2) { + $ERROR('#1: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1) === 2. Actual: ' + (push)); } //CHECK#2 -if (x.length !== 2) { - $ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x.length === 2. Actual: ' + (x.length)); +if (x.length !== 2) { + $ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x.length === 2. Actual: ' + (x.length)); } //CHECK#3 -if (x[1] !== 1) { - $ERROR('#3: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x[1] === 1. Actual: ' + (x[1])); +if (x[1] !== 1) { + $ERROR('#3: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x[1] === 1. Actual: ' + (x[1])); } //CHECK#4 delete x[1]; -if (x[1] !== -1) { - $ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); delete x[1]; x[1] === -1. Actual: ' + (x[1])); +if (x[1] !== -1) { + $ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); delete x[1]; x[1] === -1. Actual: ' + (x[1])); } //CHECK#5 delete x.length; -if (x.length !== 1) { - $ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; delete x; x.push(1); x.length === 1. Actual: ' + (x.length)); +if (x.length !== 1) { + $ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; delete x; x.push(1); x.length === 1. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js index a36fba3ae0..944c042a74 100644 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js +++ b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js @@ -3,6 +3,7 @@ /*--- info: The push property of Array can't be used as constructor +esid: sec-array.prototype.push es5id: 15.4.4.7_A6.7 description: > If property does not implement the internal [[Construct]] method, diff --git a/test/built-ins/Array/prototype/push/name.js b/test/built-ins/Array/prototype/push/name.js index 296e9ffdf9..a2eb898c04 100644 --- a/test/built-ins/Array/prototype/push/name.js +++ b/test/built-ins/Array/prototype/push/name.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: sec-array.prototype.push es6id: 22.1.3.17 description: > Array.prototype.push.name is "push".