tor-browser

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

computed-err-evaluation.js (1173B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/accessor-names/computed-err-evaluation.case
      3 // - src/accessor-names/error/cls-decl-static.template
      4 /*---
      5 description: Abrupt completion when evaluating expression (Class declaration, static method)
      6 esid: sec-runtime-semantics-classdefinitionevaluation
      7 features: [class]
      8 flags: [generated]
      9 info: |
     10    [...]
     11    21. For each ClassElement m in order from methods
     12        a. If IsStatic of m is false, then
     13           [...]
     14        b. Else,
     15           a. Let status be the result of performing PropertyDefinitionEvaluation
     16              for m with arguments F and false.
     17 
     18 
     19    12.2.6.7 Runtime Semantics: Evaluation
     20 
     21    ComputedPropertyName : [ AssignmentExpression ]
     22 
     23    1. Let exprValue be the result of evaluating AssignmentExpression.
     24    2. Let propName be ? GetValue(exprValue).
     25 ---*/
     26 var thrower = function() {
     27  throw new Test262Error();
     28 };
     29 
     30 
     31 assert.throws(Test262Error, function() {
     32  class C {
     33    static get [thrower()]() {}
     34  }
     35 }, '`get` accessor');
     36 
     37 assert.throws(Test262Error, function() {
     38  class C {
     39    static set [thrower()](_) {}
     40  }
     41 }, '`set` accessor');
     42 
     43 reportCompare(0, 0);