tor-browser

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

let-newline-await-in-async-function.js (771B)


      1 // |reftest| error:SyntaxError
      2 // Copyright (C) 2017 Mozilla Corporation. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 author: Jeff Walden <jwalden+code@mit.edu>
      7 esid: sec-let-and-const-declarations
      8 description: >
      9  `let await` does not permit ASI in between, as `await` is a BindingIdentifier
     10 info: |
     11  `await` is a perfectly cromulent binding name in any context grammatically, just
     12  prohibited by static semantics in some contexts.  Therefore ASI can never apply
     13  between `let` (where a LexicalDeclaration is permitted) and `await`,
     14  so a subsequent `0` where `=` was expected is a syntax error.
     15 negative:
     16  phase: parse
     17  type: SyntaxError
     18 ---*/
     19 
     20 $DONOTEVALUATE();
     21 
     22 async function f() {
     23    let
     24    await 0;
     25 }