tor-browser

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

prop-expr-uninitialized-this-putvalue-compound-assign.js (778B)


      1 // Copyright (C) 2024 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-super-keyword-runtime-semantics-evaluation
      6 description: >
      7  Expression not evaluated when this binding is uninitialized in PutValue context with compound assignment.
      8 info: |
      9  13.3.7.1 Runtime Semantics: Evaluation
     10 
     11    SuperProperty : super [ Expression ]
     12 
     13    ...
     14    2. Let actualThis be ? env.GetThisBinding().
     15    3. Let propertyNameReference be ? Evaluation of Expression.
     16    ...
     17 ---*/
     18 
     19 class Base {
     20  constructor() {
     21    throw new Test262Error("base constructor");
     22  }
     23 }
     24 
     25 class Derived extends Base {
     26  constructor() {
     27    super[super()] += 0;
     28  }
     29 }
     30 
     31 assert.throws(ReferenceError, () => new Derived);
     32 
     33 reportCompare(0, 0);