tor-browser

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

arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-2.js (939B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/eval-err-contains-supercall-2.case
      3 // - src/class-elements/initializer-eval-super-call/cls-decl-private-fields-indirect-eval-arrow-body.template
      4 /*---
      5 description: error if `super().x` in StatementList of eval (indirect eval)
      6 esid: sec-performeval-rules-in-initializer
      7 features: [class, class-fields-public, class-fields-private]
      8 flags: [generated]
      9 info: |
     10    Additional Early Error Rules for Eval Outside Constructor Methods
     11    These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
     12    ScriptBody : StatementList
     13 
     14      It is a Syntax Error if StatementList Contains SuperCall.
     15 
     16 ---*/
     17 
     18 
     19 class A {}
     20 class C extends A {
     21  #x = (0, eval)('() => super().x;');
     22 }
     23 
     24 assert.throws(SyntaxError, function() {
     25  new C().x();
     26 });
     27 
     28 
     29 reportCompare(0, 0);