grammar-privatemeth-duplicate-get-set.js (756B)
1 // This file was procedurally generated from the following sources: 2 // - src/class-elements/grammar-privatemeth-duplicate-get-set.case 3 // - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template 4 /*--- 5 description: It's valid if a class contains a private getter and a private setter with the same name (class declaration) 6 esid: prod-ClassElement 7 features: [class-methods-private, class] 8 flags: [generated] 9 info: | 10 Static Semantics: Early Errors 11 12 ClassBody : ClassElementList 13 It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. 14 15 ---*/ 16 17 18 class C { 19 get #m() {} 20 set #m(_) {} 21 } 22 23 reportCompare(0, 0);