bug1948958.js (613B)
1 function testClassesWithNoPrivateMembers() { 2 class C { 3 x; 4 y; 5 z; 6 } 7 const c = new C(); 8 assertEq(Object.keys(c).length == 3, true); 9 } 10 11 function testClassesWithPrivateMembers() { 12 class C { 13 x; 14 y; 15 z; 16 #a; 17 } 18 const c = new C(); 19 assertEq(Object.keys(c).length == 3, true); 20 } 21 22 function testClassesWithConstructorMembers() { 23 class C { 24 x; 25 y; 26 z; 27 constructor() { 28 this.a = 1; 29 } 30 } 31 const c = new C(); 32 assertEq(Object.keys(c).length == 4, true); 33 } 34 35 testClassesWithConstructorMembers(); 36 testClassesWithNoPrivateMembers(); 37 testClassesWithPrivateMembers();