tor-browser

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

2nd-param-with-value-abrupt.js (1302B)


      1 // |reftest| async
      2 // Copyright (C) 2021 the V8 project authors. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 description: >
      6  Rejects promise when retrieving a value of the `assert` object produces an
      7  abrupt completion
      8 esid: sec-import-call-runtime-semantics-evaluation
      9 info: |
     10  2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
     11    [...]
     12    10. If options is not undefined, then
     13           [...]
     14        d. If assertionsObj is not undefined,
     15           [...]
     16           ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key).
     17           iii. IfAbruptRejectPromise(keys, promiseCapability).
     18           iv. Let supportedAssertions be ! HostGetSupportedImportAssertions().
     19           v. For each String key of keys,
     20              1. Let value be Get(assertionsObj, key).
     21              2. IfAbruptRejectPromise(value, promiseCapability).
     22    [...]
     23 features: [dynamic-import, import-attributes]
     24 flags: [async]
     25 ---*/
     26 
     27 var thrown = new Test262Error();
     28 
     29 import('./2nd-param_FIXTURE.js', {with:{get ''() { throw thrown; }}})
     30  .then(function() {
     31    throw new Test262Error('Expected promise to be rejected, but it was fulfilled');
     32  }, function(error) {
     33    assert.sameValue(error, thrown);
     34  })
     35  .then($DONE, $DONE);