tor-browser

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

inst-private-name-common.js (1759B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/accessor-names/private-name-common.case
      3 // - src/accessor-names/private/cls-private-decl-inst.template
      4 /*---
      5 description: Private IdentifierName - common (Class declaration, private instance method)
      6 features: [class, class-methods-private]
      7 flags: [generated]
      8 info: |
      9    ClassElement :
     10      MethodDefinition
     11      static MethodDefinition
     12      FieldDefinition ;
     13      ;
     14 
     15    FieldDefinition :
     16      ClassElementName Initializer _opt
     17 
     18    ClassElementName :
     19      PropertyName
     20      PrivateName
     21 
     22    PrivateName ::
     23      # IdentifierName
     24 
     25    Initializer :
     26      = AssignmentExpression
     27 
     28    IdentifierName ::
     29      IdentifierStart
     30      IdentifierName IdentifierPart
     31 
     32    IdentifierStart ::
     33      UnicodeIDStart
     34      $
     35      _
     36      \ UnicodeEscapeSequence
     37 
     38    IdentifierPart::
     39      UnicodeIDContinue
     40      $
     41      \ UnicodeEscapeSequence
     42      <ZWNJ> <ZWJ>
     43 
     44    UnicodeIDStart::
     45      any Unicode code point with the Unicode property "ID_Start"
     46 
     47    UnicodeIDContinue::
     48      any Unicode code point with the Unicode property "ID_Continue"
     49 
     50 
     51    NOTE 3
     52    The sets of code points with Unicode properties "ID_Start" and
     53    "ID_Continue" include, respectively, the code points with Unicode
     54    properties "Other_ID_Start" and "Other_ID_Continue".
     55 
     56 ---*/
     57 
     58 var stringSet;
     59 
     60 class C {
     61  get #test262() { return 'get string'; }
     62  set #test262(param) { stringSet = param; }
     63 
     64  getPrivateReference() {
     65    return this.#test262;
     66  }
     67 
     68  setPrivateReference(value) {
     69    this.#test262 = value;
     70  }
     71 };
     72 
     73 var inst = new C();
     74 
     75 assert.sameValue(inst.getPrivateReference(), 'get string');
     76 
     77 inst.setPrivateReference('set string');
     78 assert.sameValue(stringSet, 'set string');
     79 
     80 reportCompare(0, 0);