tor-browser

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

super-property-topropertykey.js (777B)


      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-delete-operator-runtime-semantics-evaluation
      6 description: >
      7  ToPropertyKey not performed when deleting a super reference.
      8 info: |
      9  13.5.1.2 Runtime Semantics: Evaluation
     10 
     11    UnaryExpression : delete UnaryExpression
     12 
     13    1. Let ref be ? Evaluation of UnaryExpression.
     14    ...
     15    4. If IsPropertyReference(ref) is true, then
     16      ...
     17      b. If IsSuperReference(ref) is true, throw a ReferenceError exception.
     18 ---*/
     19 
     20 var key = {
     21  toString() {
     22    throw new Test262Error("ToPropertyKey performed");
     23  }
     24 };
     25 
     26 var obj = {
     27  m() {
     28    delete super[key];
     29  }
     30 };
     31 
     32 assert.throws(ReferenceError, () => obj.m());
     33 
     34 reportCompare(0, 0);