tor-browser

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

init-err-evaluation.js (934B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/init-err-evaluation.case
      3 // - src/class-elements/default/cls-decl.template
      4 /*---
      5 description: Return abrupt completion evaluating the field initializer (field definitions in a class declaration)
      6 esid: prod-FieldDefinition
      7 features: [class-fields-public, class]
      8 flags: [generated]
      9 info: |
     10    [[Construct]] ( argumentsList, newTarget)
     11 
     12    8. If kind is "base", then
     13      a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
     14      b. Let result be InitializeInstanceFields(thisArgument, F).
     15      ...
     16    ...
     17    11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     18    ...
     19 
     20 ---*/
     21 var x = 0;
     22 function fn1() { x += 1; }
     23 function fn2() { throw new Test262Error(); }
     24 
     25 
     26 class C {
     27  x = fn1();
     28  y = fn2();
     29  z = fn1();
     30 }
     31 
     32 assert.throws(Test262Error, function() {
     33  new C();
     34 });
     35 
     36 assert.sameValue(x, 1);
     37 
     38 reportCompare(0, 0);