Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Array / fromAsync / asyncitems-symbol.js
blob335a1d1325e81d0456df100a216786451011d898
1 // |reftest| async
2 // Copyright (C) 2022 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-array.fromasync
7 description: >
8   Array.fromAsync treats a Symbol as an array-like
9 includes: [asyncHelpers.js, compareArray.js]
10 flags: [async]
11 features: [Array.fromAsync]
12 ---*/
14 asyncTest(async function () {
15   Symbol.prototype.length = 2;
16   Symbol.prototype[0] = 1;
17   Symbol.prototype[1] = 2;
19   const result = await Array.fromAsync(Symbol());
20   assert.compareArray(result, [1, 2]);
21 });