tor-browser

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

top-level-import-then-is-call-expression-square-brackets.js (1298B)


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/dynamic-import/is-call-expression-square-brackets.case
      4 // - src/dynamic-import/default/top-level.template
      5 /*---
      6 description: ImportCall is a CallExpression, it can be followed by square brackets (top level)
      7 esid: sec-import-call-runtime-semantics-evaluation
      8 features: [dynamic-import]
      9 flags: [generated, async]
     10 info: |
     11    ImportCall :
     12        import( AssignmentExpression )
     13 
     14    1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
     15    2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
     16    3. Let argRef be the result of evaluating AssignmentExpression.
     17    4. Let specifier be ? GetValue(argRef).
     18    5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
     19    6. Let specifierString be ToString(specifier).
     20    7. IfAbruptRejectPromise(specifierString, promiseCapability).
     21    8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
     22    9. Return promiseCapability.[[Promise]].
     23 
     24 ---*/
     25 // import('./dynamic-import-module_FIXTURE.js')
     26 
     27 
     28 import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
     29 
     30  assert.sameValue(imported.x, 1);
     31 
     32 }).then($DONE, $DONE).catch($DONE);