tor-browser

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

nested-derived-cls-indirect-eval-contains-superproperty-2.js (1031B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/eval-contains-superproperty-2.case
      3 // - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-nested.template
      4 /*---
      5 description: super['x'] in StatementList of eval (indirect eval)
      6 esid: sec-performeval-rules-in-initializer
      7 features: [class, class-fields-public]
      8 flags: [generated]
      9 info: |
     10    The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
     11 
     12    Additional Early Error Rules for Eval Outside Methods
     13 
     14      These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
     15 
     16      ScriptBody : StatementList
     17 
     18      It is a Syntax Error if StatementList Contains SuperProperty.
     19 
     20 ---*/
     21 
     22 
     23 var executed = false;
     24 var A = class {}
     25 var C = class extends A {
     26  x = (0, eval)('executed = true; super["x"];');
     27 };
     28 
     29 assert.throws(SyntaxError, function() {
     30  new C();
     31 });
     32 
     33 assert.sameValue(executed, false);
     34 
     35 reportCompare(0, 0);