tor-browser

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

head-lhs-let.js (937B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-iteration-statements
      5 es6id: 13.7
      6 description: >
      7  The `let` token is interpreted as an Identifier when it is not followed by a
      8  `[` token
      9 info: |
     10  Syntax
     11 
     12  IterationStatement[Yield, Return]:
     13 
     14    for ( [lookahead ∉ { let [ } ] LeftHandSideExpression[?Yield] in
     15      Expression[+In, ?Yield] ) Statement[?Yield, ?Return]
     16 
     17    for ( ForDeclaration[?Yield] in Expression[+In, ?Yield] )
     18      Statement[?Yield, ?Return]
     19 flags: [noStrict]
     20 ---*/
     21 
     22 var obj = Object.create(null);
     23 var let, value;
     24 
     25 obj.key = 1;
     26 
     27 for ( let in obj ) ;
     28 
     29 assert.sameValue(let, 'key', 'IdentifierReference');
     30 
     31 Object.defineProperty(Array.prototype, '1', {
     32  set: function(param) {
     33    value = param;
     34  }
     35 });
     36 for ( [let][1] in obj ) ;
     37 
     38 assert.sameValue(value, 'key', 'MemberExpression');
     39 
     40 reportCompare(0, 0);