tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

sync-iterable-with-thenable-async-mapped-callback-err.js (607B)


      1 // |reftest| async
      2 // Copyright (C) 2023 Igalia, S.L. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-array.fromasync
      7 description: Sync-iterable input with thenable result promise rejects if async map function callback throws. 
      8 includes: [asyncHelpers.js]
      9 flags: [async]
     10 features: [Array.fromAsync]
     11 ---*/
     12 
     13 asyncTest(async function () {
     14  const input = [ Promise.resolve(0) ].values();
     15  const outputPromise = Array.fromAsync(input, async v => {
     16    throw new Test262Error;
     17  });
     18  await assert.throwsAsync(Test262Error, () => outputPromise);
     19 });