inst-private-name-u2118.js (1744B)
1 // This file was procedurally generated from the following sources: 2 // - src/accessor-names/private-name-u2118.case 3 // - src/accessor-names/private/cls-private-expr-inst.template 4 /*--- 5 description: Private IdentifierName - ℘ (Class expression, instance private 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 var C = class { 61 get #℘() { return 'get string'; } 62 set #℘(param) { stringSet = param; } 63 64 getPrivateReference() { 65 return this.#℘; 66 } 67 68 setPrivateReference(value) { 69 this.#℘ = 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);