From 79f087814fb2e821619e0a27fc7272f8f2bef317 Mon Sep 17 00:00:00 2001 From: Rezvan Mahdavi Hezaveh <31081679+rmahdav@users.noreply.github.com> Date: Mon, 18 Sep 2023 17:45:49 -0700 Subject: [PATCH] Update two constructor tests of Array.fromAsync (#3926) * Update two constructor tests of Array.fromAsync * Remove extra comment --------- Co-authored-by: Rezvan Mahdavi Hezaveh --- .../built-ins/Array/fromAsync/this-constructor-operations.js | 2 -- test/built-ins/Array/fromAsync/this-constructor.js | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/built-ins/Array/fromAsync/this-constructor-operations.js b/test/built-ins/Array/fromAsync/this-constructor-operations.js index 1a66f19a7c..ae66844c21 100644 --- a/test/built-ins/Array/fromAsync/this-constructor-operations.js +++ b/test/built-ins/Array/fromAsync/this-constructor-operations.js @@ -58,9 +58,7 @@ asyncTest(async function () { actualCalls.splice(0); // reset - // Note https://github.com/tc39/proposal-array-from-async/issues/35 const expectedCallsForArrayLike = [ - "construct MyArray", "construct MyArray", "defineProperty A[0]", "defineProperty A[1]", diff --git a/test/built-ins/Array/fromAsync/this-constructor.js b/test/built-ins/Array/fromAsync/this-constructor.js index c95db50c6c..cc106627cf 100644 --- a/test/built-ins/Array/fromAsync/this-constructor.js +++ b/test/built-ins/Array/fromAsync/this-constructor.js @@ -47,7 +47,6 @@ asyncTest(async function () { assert.sameValue(result.length, 2, "length is set on result"); assert.sameValue(result[0], 1, "element 0 is set on result"); assert.sameValue(result[1], 2, "element 1 is set on result"); - assert.sameValue(constructorCalls.length, 2, "constructor is called twice"); - assert.compareArray(constructorCalls[0], [], "constructor is called first with no arguments"); - assert.compareArray(constructorCalls[1], [2], "constructor is called second with a length argument"); + assert.sameValue(constructorCalls.length, 1, "constructor is called once"); + assert.compareArray(constructorCalls[0], [2], "constructor is called with a length argument"); });