tor-browser

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

eval-class-block-with-labels.js (1008B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/statementList/block-with-labels.case
      3 // - src/statementList/default/eval-class-declaration.template
      4 /*---
      5 description: Block with a label (Valid syntax of StatementList starting with a Class Declaration)
      6 esid: prod-StatementList
      7 features: [class]
      8 flags: [generated]
      9 info: |
     10    StatementList:
     11      StatementListItem
     12      StatementList StatementListItem
     13 
     14    StatementListItem:
     15      Statement
     16      Declaration
     17 
     18    Declaration:
     19      ClassDeclaration
     20 
     21 
     22    Statement:
     23      BlockStatement
     24      VariableStatement
     25      EmptyStatement
     26      ExpressionStatement
     27      ...
     28 
     29    // lookahead here prevents capturing an Object literal
     30    ExpressionStatement:
     31      [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
     32        Expression ;
     33 ---*/
     34 
     35 
     36 var result = eval('class C {}{x: 42};');
     37 
     38 assert.sameValue(result, 42, 'it does not evaluate to an Object with the property x');
     39 
     40 reportCompare(0, 0);