tor-browser

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

var-ary-ptrn-rest-init-id.js (1658B)


      1 // |reftest| error:SyntaxError
      2 // This file was procedurally generated from the following sources:
      3 // - src/dstr-binding/ary-ptrn-rest-init-id.case
      4 // - src/dstr-binding/default/for-var.template
      5 /*---
      6 description: Rest element (identifier) does not support initializer (for statement)
      7 esid: sec-for-statement-runtime-semantics-labelledevaluation
      8 features: [destructuring-binding]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    IterationStatement :
     15        for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
     16 
     17    1. Let varDcl be the result of evaluating VariableDeclarationList.
     18    [...]
     19 
     20    13.3.2.4 Runtime Semantics: Evaluation
     21 
     22    VariableDeclarationList : VariableDeclarationList , VariableDeclaration
     23 
     24    1. Let next be the result of evaluating VariableDeclarationList.
     25    2. ReturnIfAbrupt(next).
     26    3. Return the result of evaluating VariableDeclaration.
     27 
     28    VariableDeclaration : BindingPattern Initializer
     29 
     30    1. Let rhs be the result of evaluating Initializer.
     31    2. Let rval be GetValue(rhs).
     32    3. ReturnIfAbrupt(rval).
     33    4. Return the result of performing BindingInitialization for BindingPattern
     34       passing rval and undefined as arguments.
     35 
     36    13.3.3 Destructuring Binding Patterns
     37    ArrayBindingPattern[Yield] :
     38        [ Elisionopt BindingRestElement[?Yield]opt ]
     39        [ BindingElementList[?Yield] ]
     40        [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
     41 ---*/
     42 $DONOTEVALUATE();
     43 
     44 var iterCount = 0;
     45 
     46 for (var [...x = []] = []; iterCount < 1; ) {
     47  
     48  iterCount += 1;
     49 }
     50 
     51 assert.sameValue(iterCount, 1, 'Iteration occurred as expected');