tor-browser

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

this.js (1116B)


      1 // |reftest| async
      2 // Copyright (C) 2018 Leo Balter. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 description: >
      6    Dynamic Import receives an AssignmentExpression (this)
      7 esid: prod-ImportCall
      8 info: |
      9    ImportCall [Yield]:
     10        import ( AssignmentExpression[+In, ?Yield] )
     11 
     12    AssignmentExpression[In, Yield, Await]:
     13        ConditionalExpression[?In, ?Yield, ?Await]
     14        [+Yield]YieldExpression[?In, ?Await]
     15        ArrowFunction[?In, ?Yield, ?Await]
     16        AsyncArrowFunction[?In, ?Yield, ?Await]
     17        LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
     18        LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
     19 
     20    PrimaryExpression[Yield, Await]:
     21        this
     22 flags: [async]
     23 features: [dynamic-import]
     24 ---*/
     25 
     26 async function fn() {
     27    const ns1 = await import(this); // import('./module-code_FIXTURE.js')
     28 
     29    assert.sameValue(ns1.local1, 'Test262');
     30    assert.sameValue(ns1.default, 42);
     31 }
     32 
     33 fn.call('./module-code_FIXTURE.js').then($DONE, $DONE).catch($DONE);