tor-browser

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

obj-id-identifier-yield-expr.js (1287B)


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