tor-browser

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

try-reject-finally-throw.js (666B)


      1 // |reftest| async
      2 // Copyright 2017 Caitlin Potter. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 author: Caitlin Potter <caitp@igalia.com>
      7 esid: pending
      8 description: >
      9  Implementations must defer rejecting an async function's Promise until after
     10  all finally blocks have been evaluated.
     11 flags: [async]
     12 ---*/
     13 
     14 var f = async function() {
     15  try {
     16    await new Promise(function(resolve, reject) {
     17      reject("early-reject");
     18    });
     19  } finally {
     20    throw "override";
     21  }
     22 };
     23 
     24 f().then($DONE, function(value) {
     25  assert.sameValue(value, "override", "Exception thrown in finally block");
     26 }).then($DONE, $DONE);