static-private-name-u2118.js (1739B)
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-decl-static.template 4 /*--- 5 description: Private IdentifierName - ℘ (Class declaration, static method) 6 features: [class, class-static-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 static get #℘() { return 'get string'; } 62 static set #℘(param) { stringSet = param; } 63 64 static getPrivateReference() { 65 return this.#℘; 66 } 67 68 static setPrivateReference(value) { 69 this.#℘ = value; 70 } 71 } 72 73 assert.sameValue(C.getPrivateReference(), 'get string'); 74 75 C.setPrivateReference('set string'); 76 assert.sameValue(stringSet, 'set string'); 77 78 79 reportCompare(0, 0);