From 8525cdb16523c68ae7cdaf3bc8a117d5151f4d4c Mon Sep 17 00:00:00 2001 From: Leonardo Balter Date: Fri, 17 Mar 2017 13:57:24 -0400 Subject: [PATCH] Generate tests --- .../array/spread-obj-symbol-property.js | 1 + ...amed-yield-identifier-spread-non-strict.js | 7 +++++-- .../named-yield-spread-arr-single.js | 10 ++++++--- .../yield-identifier-spread-non-strict.js | 7 +++++-- .../yield-spread-arr-single.js | 10 ++++++--- .../call/spread-obj-symbol-property.js | 1 + ...n-method-static-yield-spread-arr-single.js | 10 ++++++--- ...sync-gen-method-yield-spread-arr-single.js | 10 ++++++--- ...n-method-static-yield-spread-arr-single.js | 12 +++++++---- .../gen-method-yield-spread-arr-single.js | 12 +++++++---- ...amed-yield-identifier-spread-non-strict.js | 21 ++++++++++++------- .../named-yield-spread-arr-single.js | 12 +++++++---- .../yield-identifier-spread-non-strict.js | 21 ++++++++++++------- .../generators/yield-spread-arr-single.js | 12 +++++++---- .../new/spread-obj-symbol-property.js | 1 + ...-gen-yield-identifier-spread-non-strict.js | 7 +++++-- .../async-gen-yield-spread-arr-single.js | 10 ++++++--- .../gen-yield-identifier-spread-non-strict.js | 21 ++++++++++++------- .../gen-yield-spread-arr-single.js | 12 +++++++---- .../super/call-spread-obj-symbol-property.js | 1 + .../yield-identifier-spread-non-strict.js | 7 +++++-- .../yield-spread-arr-single.js | 10 ++++++--- ...n-method-static-yield-spread-arr-single.js | 10 ++++++--- ...sync-gen-method-yield-spread-arr-single.js | 10 ++++++--- ...n-method-static-yield-spread-arr-single.js | 12 +++++++---- .../gen-method-yield-spread-arr-single.js | 12 +++++++---- .../yield-identifier-spread-non-strict.js | 21 ++++++++++++------- .../generators/yield-spread-arr-single.js | 12 +++++++---- 28 files changed, 196 insertions(+), 96 deletions(-) diff --git a/test/language/expressions/array/spread-obj-symbol-property.js b/test/language/expressions/array/spread-obj-symbol-property.js index 8a8cedcebe..7965be9715 100644 --- a/test/language/expressions/array/spread-obj-symbol-property.js +++ b/test/language/expressions/array/spread-obj-symbol-property.js @@ -41,6 +41,7 @@ var callCount = 0; (function(obj) { assert.sameValue(obj[symbol], 1); + assert(Object.hasOwnProperty.call(obj, symbol)); assert.sameValue(obj.c, 4); assert.sameValue(obj.d, 5); assert.sameValue(Object.keys(obj).length, 2); diff --git a/test/language/expressions/async-generator/named-yield-identifier-spread-non-strict.js b/test/language/expressions/async-generator/named-yield-identifier-spread-non-strict.js index ec4367a706..d65911bb3c 100644 --- a/test/language/expressions/async-generator/named-yield-identifier-spread-non-strict.js +++ b/test/language/expressions/async-generator/named-yield-identifier-spread-non-strict.js @@ -20,6 +20,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -42,8 +43,8 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); item.then(({ done, value }) => { @@ -53,7 +54,9 @@ item.then(({ done, value }) => { assert.sameValue(value.z, 30); assert.sameValue(value.a, 1); assert.sameValue(value.b, 2); + assert.sameValue(value[s], 42); assert.sameValue(Object.keys(value).length, 5); + assert(Object.hasOwnProperty.call(value, s)); }).then($DONE, $DONE); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/async-generator/named-yield-spread-arr-single.js b/test/language/expressions/async-generator/named-yield-spread-arr-single.js index a6b0438d03..95d0853959 100644 --- a/test/language/expressions/async-generator/named-yield-spread-arr-single.js +++ b/test/language/expressions/async-generator/named-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Named async generator expression) esid: prod-AsyncGeneratorExpression flags: [generated, async] -includes: [compareArray.js] info: | Async Generator Function Definitions @@ -32,10 +31,15 @@ var gen = async function *g() { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/expressions/async-generator/yield-identifier-spread-non-strict.js b/test/language/expressions/async-generator/yield-identifier-spread-non-strict.js index 98b6583fab..8a60681c23 100644 --- a/test/language/expressions/async-generator/yield-identifier-spread-non-strict.js +++ b/test/language/expressions/async-generator/yield-identifier-spread-non-strict.js @@ -20,6 +20,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -42,8 +43,8 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); item.then(({ done, value }) => { @@ -53,7 +54,9 @@ item.then(({ done, value }) => { assert.sameValue(value.z, 30); assert.sameValue(value.a, 1); assert.sameValue(value.b, 2); + assert.sameValue(value[s], 42); assert.sameValue(Object.keys(value).length, 5); + assert(Object.hasOwnProperty.call(value, s)); }).then($DONE, $DONE); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/async-generator/yield-spread-arr-single.js b/test/language/expressions/async-generator/yield-spread-arr-single.js index 45be229091..421f0004cf 100644 --- a/test/language/expressions/async-generator/yield-spread-arr-single.js +++ b/test/language/expressions/async-generator/yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Unnamed async generator expression) esid: prod-AsyncGeneratorExpression flags: [generated, async] -includes: [compareArray.js] info: | Async Generator Function Definitions @@ -32,10 +31,15 @@ var gen = async function *() { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/expressions/call/spread-obj-symbol-property.js b/test/language/expressions/call/spread-obj-symbol-property.js index 9a26e67f60..456ccb8207 100644 --- a/test/language/expressions/call/spread-obj-symbol-property.js +++ b/test/language/expressions/call/spread-obj-symbol-property.js @@ -39,6 +39,7 @@ var callCount = 0; (function(obj) { assert.sameValue(obj[symbol], 1); + assert(Object.hasOwnProperty.call(obj, symbol)); assert.sameValue(obj.c, 4); assert.sameValue(obj.d, 5); assert.sameValue(Object.keys(obj).length, 2); diff --git a/test/language/expressions/class/async-gen-method-static-yield-spread-arr-single.js b/test/language/expressions/class/async-gen-method-static-yield-spread-arr-single.js index f9f23472f1..9c0297d6eb 100644 --- a/test/language/expressions/class/async-gen-method-static-yield-spread-arr-single.js +++ b/test/language/expressions/class/async-gen-method-static-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Static async generator method as a ClassExpression element) esid: prod-AsyncGeneratorMethod flags: [generated, async] -includes: [compareArray.js] info: | ClassElement : static MethodDefinition @@ -39,10 +38,15 @@ var gen = C.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/expressions/class/async-gen-method-yield-spread-arr-single.js b/test/language/expressions/class/async-gen-method-yield-spread-arr-single.js index 3bee88b77b..aff92093e9 100644 --- a/test/language/expressions/class/async-gen-method-yield-spread-arr-single.js +++ b/test/language/expressions/class/async-gen-method-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Async generator method as a ClassExpression element) esid: prod-AsyncGeneratorMethod flags: [generated, async] -includes: [compareArray.js] info: | ClassElement : MethodDefinition @@ -39,10 +38,15 @@ var gen = C.prototype.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/expressions/class/gen-method-static-yield-spread-arr-single.js b/test/language/expressions/class/gen-method-static-yield-spread-arr-single.js index 9e98366650..d26fc19a4c 100644 --- a/test/language/expressions/class/gen-method-static-yield-spread-arr-single.js +++ b/test/language/expressions/class/gen-method-static-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Static generator method as a ClassExpression element) esid: prod-GeneratorMethod flags: [generated] -includes: [compareArray.js] info: | ClassElement : static MethodDefinition @@ -22,7 +21,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -38,9 +36,15 @@ var gen = C.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/class/gen-method-yield-spread-arr-single.js b/test/language/expressions/class/gen-method-yield-spread-arr-single.js index a9ecc6af52..b1d9e473ba 100644 --- a/test/language/expressions/class/gen-method-yield-spread-arr-single.js +++ b/test/language/expressions/class/gen-method-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Generator method as a ClassExpression element) esid: prod-GeneratorMethod flags: [generated] -includes: [compareArray.js] info: | ClassElement : MethodDefinition @@ -22,7 +21,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -38,9 +36,15 @@ var gen = C.prototype.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/generators/named-yield-identifier-spread-non-strict.js b/test/language/expressions/generators/named-yield-identifier-spread-non-strict.js index 4931f2f953..2fa759a558 100644 --- a/test/language/expressions/generators/named-yield-identifier-spread-non-strict.js +++ b/test/language/expressions/generators/named-yield-identifier-spread-non-strict.js @@ -19,6 +19,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -40,16 +41,20 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); +var value = item.value; + assert.sameValue(item.done, false); -assert.sameValue(item.value.x, 10); -assert.sameValue(item.value.y, 20); -assert.sameValue(item.value.z, 30); -assert.sameValue(item.value.a, 1); -assert.sameValue(item.value.b, 2); -assert.sameValue(Object.keys(item.value).length, 5); +assert.sameValue(value.x, 10); +assert.sameValue(value.y, 20); +assert.sameValue(value.z, 30); +assert.sameValue(value.a, 1); +assert.sameValue(value.b, 2); +assert.sameValue(value[s], 42); +assert(Object.hasOwnProperty.call(value, s)); +assert.sameValue(Object.keys(value).length, 5); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/generators/named-yield-spread-arr-single.js b/test/language/expressions/generators/named-yield-spread-arr-single.js index eb2b8534d2..b0bd3194ef 100644 --- a/test/language/expressions/generators/named-yield-spread-arr-single.js +++ b/test/language/expressions/generators/named-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Named generator expression) esid: prod-GeneratorExpression flags: [generated] -includes: [compareArray.js] info: | 14.4 Generator Function Definitions @@ -16,7 +15,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -30,9 +28,15 @@ var gen = function *g() { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/generators/yield-identifier-spread-non-strict.js b/test/language/expressions/generators/yield-identifier-spread-non-strict.js index 2991544a06..05be96d4e7 100644 --- a/test/language/expressions/generators/yield-identifier-spread-non-strict.js +++ b/test/language/expressions/generators/yield-identifier-spread-non-strict.js @@ -19,6 +19,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -40,16 +41,20 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); +var value = item.value; + assert.sameValue(item.done, false); -assert.sameValue(item.value.x, 10); -assert.sameValue(item.value.y, 20); -assert.sameValue(item.value.z, 30); -assert.sameValue(item.value.a, 1); -assert.sameValue(item.value.b, 2); -assert.sameValue(Object.keys(item.value).length, 5); +assert.sameValue(value.x, 10); +assert.sameValue(value.y, 20); +assert.sameValue(value.z, 30); +assert.sameValue(value.a, 1); +assert.sameValue(value.b, 2); +assert.sameValue(value[s], 42); +assert(Object.hasOwnProperty.call(value, s)); +assert.sameValue(Object.keys(value).length, 5); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/generators/yield-spread-arr-single.js b/test/language/expressions/generators/yield-spread-arr-single.js index f9cba19aa3..52bb571f71 100644 --- a/test/language/expressions/generators/yield-spread-arr-single.js +++ b/test/language/expressions/generators/yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Unnamed generator expression) esid: prod-GeneratorExpression flags: [generated] -includes: [compareArray.js] info: | 14.4 Generator Function Definitions @@ -16,7 +15,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -30,9 +28,15 @@ var gen = function *() { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/new/spread-obj-symbol-property.js b/test/language/expressions/new/spread-obj-symbol-property.js index 33f5868345..ada48fd50f 100644 --- a/test/language/expressions/new/spread-obj-symbol-property.js +++ b/test/language/expressions/new/spread-obj-symbol-property.js @@ -38,6 +38,7 @@ var callCount = 0; new function(obj) { assert.sameValue(obj[symbol], 1); + assert(Object.hasOwnProperty.call(obj, symbol)); assert.sameValue(obj.c, 4); assert.sameValue(obj.d, 5); assert.sameValue(Object.keys(obj).length, 2); diff --git a/test/language/expressions/object/method-definition/async-gen-yield-identifier-spread-non-strict.js b/test/language/expressions/object/method-definition/async-gen-yield-identifier-spread-non-strict.js index 7bb35899c8..aaef9d3cc9 100644 --- a/test/language/expressions/object/method-definition/async-gen-yield-identifier-spread-non-strict.js +++ b/test/language/expressions/object/method-definition/async-gen-yield-identifier-spread-non-strict.js @@ -19,6 +19,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -43,8 +44,8 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); item.then(({ done, value }) => { @@ -54,7 +55,9 @@ item.then(({ done, value }) => { assert.sameValue(value.z, 30); assert.sameValue(value.a, 1); assert.sameValue(value.b, 2); + assert.sameValue(value[s], 42); assert.sameValue(Object.keys(value).length, 5); + assert(Object.hasOwnProperty.call(value, s)); }).then($DONE, $DONE); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/object/method-definition/async-gen-yield-spread-arr-single.js b/test/language/expressions/object/method-definition/async-gen-yield-spread-arr-single.js index 1650fce4cd..fb93afba31 100644 --- a/test/language/expressions/object/method-definition/async-gen-yield-spread-arr-single.js +++ b/test/language/expressions/object/method-definition/async-gen-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Async generator method) esid: prod-AsyncGeneratorMethod flags: [generated, async] -includes: [compareArray.js] info: | Async Generator Function Definitions @@ -32,10 +31,15 @@ var gen = { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/expressions/object/method-definition/gen-yield-identifier-spread-non-strict.js b/test/language/expressions/object/method-definition/gen-yield-identifier-spread-non-strict.js index 02c646bf75..53802b9726 100644 --- a/test/language/expressions/object/method-definition/gen-yield-identifier-spread-non-strict.js +++ b/test/language/expressions/object/method-definition/gen-yield-identifier-spread-non-strict.js @@ -19,6 +19,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -42,16 +43,20 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); +var value = item.value; + assert.sameValue(item.done, false); -assert.sameValue(item.value.x, 10); -assert.sameValue(item.value.y, 20); -assert.sameValue(item.value.z, 30); -assert.sameValue(item.value.a, 1); -assert.sameValue(item.value.b, 2); -assert.sameValue(Object.keys(item.value).length, 5); +assert.sameValue(value.x, 10); +assert.sameValue(value.y, 20); +assert.sameValue(value.z, 30); +assert.sameValue(value.a, 1); +assert.sameValue(value.b, 2); +assert.sameValue(value[s], 42); +assert(Object.hasOwnProperty.call(value, s)); +assert.sameValue(Object.keys(value).length, 5); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/object/method-definition/gen-yield-spread-arr-single.js b/test/language/expressions/object/method-definition/gen-yield-spread-arr-single.js index 47a3f9d5be..9fe742e13f 100644 --- a/test/language/expressions/object/method-definition/gen-yield-spread-arr-single.js +++ b/test/language/expressions/object/method-definition/gen-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Generator method) esid: prod-GeneratorMethod flags: [generated] -includes: [compareArray.js] info: | 14.4 Generator Function Definitions @@ -16,7 +15,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -32,9 +30,15 @@ var gen = { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/expressions/super/call-spread-obj-symbol-property.js b/test/language/expressions/super/call-spread-obj-symbol-property.js index dd34984389..94ba4324f0 100644 --- a/test/language/expressions/super/call-spread-obj-symbol-property.js +++ b/test/language/expressions/super/call-spread-obj-symbol-property.js @@ -37,6 +37,7 @@ var callCount = 0; class Test262ParentClass { constructor(obj) { assert.sameValue(obj[symbol], 1); + assert(Object.hasOwnProperty.call(obj, symbol)); assert.sameValue(obj.c, 4); assert.sameValue(obj.d, 5); assert.sameValue(Object.keys(obj).length, 2); diff --git a/test/language/statements/async-generator/yield-identifier-spread-non-strict.js b/test/language/statements/async-generator/yield-identifier-spread-non-strict.js index 35c9b4fa92..dd2759f3f7 100644 --- a/test/language/statements/async-generator/yield-identifier-spread-non-strict.js +++ b/test/language/statements/async-generator/yield-identifier-spread-non-strict.js @@ -20,6 +20,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -42,8 +43,8 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); item.then(({ done, value }) => { @@ -53,7 +54,9 @@ item.then(({ done, value }) => { assert.sameValue(value.z, 30); assert.sameValue(value.a, 1); assert.sameValue(value.b, 2); + assert.sameValue(value[s], 42); assert.sameValue(Object.keys(value).length, 5); + assert(Object.hasOwnProperty.call(value, s)); }).then($DONE, $DONE); assert.sameValue(callCount, 1); diff --git a/test/language/statements/async-generator/yield-spread-arr-single.js b/test/language/statements/async-generator/yield-spread-arr-single.js index 80a9641244..b2a3063395 100644 --- a/test/language/statements/async-generator/yield-spread-arr-single.js +++ b/test/language/statements/async-generator/yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Async generator Function declaration) esid: prod-AsyncGeneratorDeclaration flags: [generated, async] -includes: [compareArray.js] info: | Async Generator Function Definitions @@ -32,10 +31,15 @@ async function *gen() { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/statements/class/async-gen-method-static-yield-spread-arr-single.js b/test/language/statements/class/async-gen-method-static-yield-spread-arr-single.js index 3df12ef903..8ae48c2a72 100644 --- a/test/language/statements/class/async-gen-method-static-yield-spread-arr-single.js +++ b/test/language/statements/class/async-gen-method-static-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Static async generator method as a ClassDeclaration element) esid: prod-AsyncGeneratorMethod flags: [generated, async] -includes: [compareArray.js] info: | ClassElement : static MethodDefinition @@ -39,10 +38,15 @@ var gen = C.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/statements/class/async-gen-method-yield-spread-arr-single.js b/test/language/statements/class/async-gen-method-yield-spread-arr-single.js index 0a34a9577e..acb035bacb 100644 --- a/test/language/statements/class/async-gen-method-yield-spread-arr-single.js +++ b/test/language/statements/class/async-gen-method-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Async Generator method as a ClassDeclaration element) esid: prod-AsyncGeneratorMethod flags: [generated, async] -includes: [compareArray.js] info: | ClassElement : MethodDefinition @@ -39,10 +38,15 @@ var gen = C.prototype.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); item.then(({ done, value }) => { - assert(compareArray(value, arr)); + assert.notSameValue(value, arr, 'value is a new array'); + assert(Array.isArray(value), 'value is an Array exotic object'); + assert.sameValue(value.length, 3) + assert.sameValue(value[0], 'a'); + assert.sameValue(value[1], 'b'); + assert.sameValue(value[2], 'c'); assert.sameValue(done, false); }).then($DONE, $DONE); diff --git a/test/language/statements/class/gen-method-static-yield-spread-arr-single.js b/test/language/statements/class/gen-method-static-yield-spread-arr-single.js index 900dc84d46..5a74810166 100644 --- a/test/language/statements/class/gen-method-static-yield-spread-arr-single.js +++ b/test/language/statements/class/gen-method-static-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Static generator method as a ClassDeclaration element) esid: prod-GeneratorMethod flags: [generated] -includes: [compareArray.js] info: | ClassElement : static MethodDefinition @@ -22,7 +21,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -38,9 +36,15 @@ var gen = C.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/statements/class/gen-method-yield-spread-arr-single.js b/test/language/statements/class/gen-method-yield-spread-arr-single.js index 6ae9e72200..86b634eb17 100644 --- a/test/language/statements/class/gen-method-yield-spread-arr-single.js +++ b/test/language/statements/class/gen-method-yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Geenerator method as a ClassDeclaration element) esid: prod-GeneratorMethod flags: [generated] -includes: [compareArray.js] info: | ClassElement : MethodDefinition @@ -22,7 +21,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -38,9 +36,15 @@ var gen = C.prototype.gen; var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1); diff --git a/test/language/statements/generators/yield-identifier-spread-non-strict.js b/test/language/statements/generators/yield-identifier-spread-non-strict.js index 3fa89b1dfa..0490ee4ac4 100644 --- a/test/language/statements/generators/yield-identifier-spread-non-strict.js +++ b/test/language/statements/generators/yield-identifier-spread-non-strict.js @@ -19,6 +19,7 @@ info: | ...AssignmentExpression[In, ?Yield] ---*/ +var s = Symbol('s'); var callCount = 0; @@ -40,16 +41,20 @@ var iter = gen(); iter.next(); iter.next(); -iter.next({ x: 10, a: 0, b: 0 }); -iter.next({ y: 20, a: 1, b: 1 }); +iter.next({ x: 10, a: 0, b: 0, [s]: 1 }); +iter.next({ y: 20, a: 1, b: 1, [s]: 42 }); var item = iter.next({ z: 30, b: 2 }); +var value = item.value; + assert.sameValue(item.done, false); -assert.sameValue(item.value.x, 10); -assert.sameValue(item.value.y, 20); -assert.sameValue(item.value.z, 30); -assert.sameValue(item.value.a, 1); -assert.sameValue(item.value.b, 2); -assert.sameValue(Object.keys(item.value).length, 5); +assert.sameValue(value.x, 10); +assert.sameValue(value.y, 20); +assert.sameValue(value.z, 30); +assert.sameValue(value.a, 1); +assert.sameValue(value.b, 2); +assert.sameValue(value[s], 42); +assert(Object.hasOwnProperty.call(value, s)); +assert.sameValue(Object.keys(value).length, 5); assert.sameValue(callCount, 1); diff --git a/test/language/statements/generators/yield-spread-arr-single.js b/test/language/statements/generators/yield-spread-arr-single.js index 00aaba1eca..1ef357eec9 100644 --- a/test/language/statements/generators/yield-spread-arr-single.js +++ b/test/language/statements/generators/yield-spread-arr-single.js @@ -5,7 +5,6 @@ description: Use yield value in a array spread position (Generator Function declaration) esid: prod-GeneratorDeclaration flags: [generated] -includes: [compareArray.js] info: | 14.4 Generator Function Definitions @@ -16,7 +15,6 @@ info: | SpreadElement[Yield, Await]: ...AssignmentExpression[+In, ?Yield, ?Await] - ---*/ var arr = ['a', 'b', 'c']; @@ -30,9 +28,15 @@ function *gen() { var iter = gen(); iter.next(false); -var item = iter.next(['a', 'b', 'c']); +var item = iter.next(arr); +var value = item.value; -assert(compareArray(item.value, arr)); +assert.notSameValue(value, arr, 'value is a new array'); +assert(Array.isArray(value), 'value is an Array exotic object'); +assert.sameValue(value.length, 3) +assert.sameValue(value[0], 'a'); +assert.sameValue(value[1], 'b'); +assert.sameValue(value[2], 'c'); assert.sameValue(item.done, false); assert.sameValue(callCount, 1);