tor-browser

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

await-in-nested-generator.js (478B)


      1 // Copyright 2016 Microsoft, Inc. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 author: Brian Terlson <brian.terlson@microsoft.com>
      6 esid: pending
      7 description: >
      8  Await is allowed as an identifier in generator functions nested in async functions
      9 features: [generators]
     10 ---*/
     11 
     12 var await;
     13 async function foo() {
     14  function* bar() {
     15    await = 1;
     16  }
     17  bar().next();
     18 }
     19 foo();
     20 
     21 assert.sameValue(await, 1);
     22 
     23 reportCompare(0, 0);