tor-browser

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

evaluation-body-that-throws.js (483B)


      1 // |reftest| async
      2 // Copyright 2016 Microsoft, Inc. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 author: Brian Terlson <brian.terlson@microsoft.com>
      7 esid: pending
      8 description: >
      9  Errors thrown from the async function body reject the returned promise
     10 flags: [async]
     11 ---*/
     12 
     13 async function foo() {
     14  throw 1;
     15 }
     16 
     17 foo().then(function () {
     18  $DONE("Should not be called");
     19 }, function (e) {
     20  assert.sameValue(e, 1);
     21  $DONE();
     22 });