tor-browser

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

generator-param-redecl-const.js (475B)


      1 // |reftest| error:SyntaxError
      2 // Copyright 2015 Cubane Canada, Inc.  All rights reserved.
      3 // See LICENSE for details.
      4 
      5 /*---
      6 info: |
      7 GeneratorMethod early SyntaxError when lexical declaration
      8 inside generator shadows parameter name
      9 features: [generators]
     10 es6id: 14.4.1
     11 author: Sam Mikes
     12 description: GeneratorMethod error with lexical shadowing
     13 negative:
     14  phase: parse
     15  type: SyntaxError
     16 ---*/
     17 
     18 $DONOTEVALUATE();
     19 
     20 var obj = {
     21    *foo(a) {
     22        const a = 3;
     23    }
     24 };