good.ts 572 B

1234567891011121314151617181920212223
  1. // good 类成员排序正确
  2. class Foo1 {
  3. public static foo1 = 'foo1';
  4. protected static foo2 = 'foo2';
  5. private static foo3 = 'foo3';
  6. public static getFoo1() {}
  7. protected static getFoo2() {}
  8. private static getFoo3() {
  9. return Foo1.foo3;
  10. }
  11. public bar1 = 'bar1';
  12. protected bar2 = 'bar2';
  13. private bar3 = 'bar3';
  14. public constructor() {
  15. console.log(Foo1.getFoo3());
  16. console.log(this.getBar3());
  17. }
  18. public getBar1() {}
  19. protected getBar2() {}
  20. private getBar3() {
  21. return this.bar3;
  22. }
  23. }