tor-browser

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

obj-id-init-yield-ident-invalid-strict.js (1341B)


      1 // |reftest| error:SyntaxError
      2 'use strict';
      3 // This file was procedurally generated from the following sources:
      4 // - src/dstr-assignment/obj-id-init-yield-ident-invalid.case
      5 // - src/dstr-assignment/syntax/for-in.template
      6 /*---
      7 description: When a `yield` token appears within the Initializer of an AssignmentProperty and outside of a generator function body, it should behave as an IdentifierReference. (For..in statement)
      8 esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
      9 features: [destructuring-binding]
     10 flags: [generated, onlyStrict]
     11 negative:
     12  phase: parse
     13  type: SyntaxError
     14 info: |
     15    IterationStatement :
     16      for ( LeftHandSideExpression of AssignmentExpression ) Statement
     17 
     18    1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
     19       AssignmentExpression, iterate).
     20    2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
     21       keyResult, assignment, labelSet).
     22 
     23    13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
     24 
     25    [...]
     26    4. If destructuring is true and if lhsKind is assignment, then
     27       a. Assert: lhs is a LeftHandSideExpression.
     28       b. Let assignmentPattern be the parse of the source text corresponding to
     29          lhs using AssignmentPattern as the goal symbol.
     30    [...]
     31 ---*/
     32 $DONOTEVALUATE();
     33 
     34 for ({ x = yield } in [{}]) ;