• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// @KeepSymbol
17class MyClass01 {
18  static staticProperty01 = 1;
19
20  property02: string;
21
22  constructor(property02: string, public property03: number) {
23    this.property02 = property02;
24    this.property03 = 2;
25  }
26
27  myMethod01(): void{};
28
29  static myStaticMethod(): void{};
30
31  get myGetter(): string {
32    return this.property02;
33  }
34
35  set mySetter(value: string) {
36    this.property02 = value;
37  }
38}
39
40// @KeepSymbol
41export class MyClass02 {
42  static staticProperty01 = 1;
43
44  property03: string;
45}
46
47class MyClass03 {
48  // @KeepSymbol
49  constructor(){}
50}
51
52export class MyClass04 {
53  // @KeepSymbol
54  constructor(){}
55}
56
57class MyClass05 {
58  // @KeepSymbol
59  static staticProperty05_01 = 1;
60
61  // @KeepSymbol
62  property05_02: string;
63
64  // @KeepSymbol
65  constructor(property05_02: string, public property05_03: number) {
66    this.property05_02 = property05_02;
67    this.property05_03 = 2;
68  }
69
70  // @KeepSymbol
71  myMethod05_01(): void{};
72
73  // @KeepSymbol
74  static myStaticMethod05(): void{};
75
76  // @KeepSymbol
77  get myGetter05(): string {
78    return this.property05_02;
79  }
80
81  // @KeepSymbol
82  set mySetter05(value: string) {
83    this.property05_02 = value;
84  }
85}
86
87export class MyClass06 {
88  // @KeepSymbol
89  property06: string;
90}
91
92export class MyClass07 {
93  // not supported cases
94  // @KeepSymbol @KeepSymbol
95  property07_01: string;
96
97  property07_02: string; // @KeepSymbol
98
99  // @@KeepSymbol
100  property07_03: string;
101
102  //// @KeepSymbol
103  property07_04: string;
104
105  // cases will be collected
106  // @KeepSymbol
107  property07_05: string;
108
109  //  @KeepSymbol
110  property07_06: string;
111
112  //    @KeepSymbol
113  property07_07: string;
114
115  //@KeepSymbol
116  property07_08: string;
117}
118
119const myMethod: string = "myMethod";
120export class MyClass08 {
121  // @KeepSymbol
122  'aa': 'bb';
123  // @KeepSymbol
124  11:11;
125  // @KeepSymbol
126  [myMethod](){}
127}