tor-browser

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

eval-block-regexp-literal.js (1142B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/statementList/regexp-literal.case
      3 // - src/statementList/default/eval-block.template
      4 /*---
      5 description: Regular Expression Literal (Eval production of StatementList starting with a BlockStatement)
      6 esid: prod-StatementList
      7 flags: [generated]
      8 info: |
      9    StatementList:
     10      StatementListItem
     11      StatementList StatementListItem
     12 
     13    StatementListItem:
     14      Statement
     15      Declaration
     16 
     17    Statement:
     18      BlockStatement
     19 
     20    BlockStatement:
     21      Block
     22 
     23    Block:
     24      { StatementList_opt }
     25 
     26    Statement:
     27      BlockStatement
     28      VariableStatement
     29      EmptyStatement
     30      ExpressionStatement
     31      ...
     32 
     33    ExpressionStatement[Yield, Await]:
     34      [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
     35        Expression ;
     36 
     37    RegularExpressionLiteral ::
     38      / RegularExpressionBody / RegularExpressionFlags
     39 ---*/
     40 
     41 
     42 var result = eval('{}/1/;');
     43 
     44 assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype);
     45 assert.sameValue(result.flags, '');
     46 assert.sameValue(result.toString(), '/1/');
     47 
     48 reportCompare(0, 0);