1/* 2 * Copyright (c) 2023 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 16function logClassName(constructor: Function) { 17 console.log(`Class name: ${constructor.name}`); 18} 19 20function logProperty1(target: any, key: string) { 21 console.log(`Property name: ${key}`); 22} 23function logProperty2(target: any, key: string) { 24 console.log(`Property name: ${key}`); 25} 26 27@logClassName 28class ExampleClass { 29 @logProperty1 @logProperty2 30 private someProperty: string; // commentssssss 31 @logProperty2 32 @logProperty1 33 public secondProperty: number; 34 35 @logProperty1 36 async foo(): Promise<any> { } 37} 38function foo() { 39 let a1 = 1 40 let a2 = 2; 41 let a3 = 3 42 let a4 = 4 43 let a5 = 5 44}