tor-browser

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

classelementname-abrupt-completion.js (1542B)


      1 // Copyright (C) 2017 Valerie Young. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 description: Class definition should error if evaluation of ClassElementName errors
      6 esid: sec-runtime-semantics-classdefinitionevaluation
      7 info: |
      8  Runtime Semantics: ClassDefinitionEvaluation
      9  ...
     10  27. For each ClassElement e in order from elements
     11    a. If IsStatic of e is false, then
     12        i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
     13    b. Else,
     14        i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
     15    c. If fields is an abrupt completion, then
     16        i. Set the running execution context's LexicalEnvironment to lex.
     17        ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
     18        iii. Return Completion(status).
     19 
     20  Runtime Semantics: ClassElementEvaluation
     21  ...
     22    ClassElement : FieldDefinition ;
     23      1. Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
     24 
     25  Runtime Semantics: ClassFieldDefinitionEvaluation
     26  With parameters isStatic and homeObject.
     27    FieldDefinition : ClassElementNameInitializer
     28      1. Let fieldName be the result of evaluating ClassElementName.
     29      2. ReturnIfAbrupt(fieldName).
     30 
     31 features: [class, class-fields-public]
     32 ---*/
     33 
     34 function f() {
     35  throw new Test262Error();
     36 }
     37 
     38 assert.throws(Test262Error, function() {
     39  class C {
     40    [f()]
     41  }
     42 });
     43 
     44 reportCompare(0, 0);