1/* 2 * Copyright (c) 2022 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 17enum tsEnum2 { 18 a, 19 b = 10 + 10 * 10 / 2 -1, 20 c = 3, 21 d = 1 << 5, 22 "e", 23 f = d + tsEnum2.c + 10, 24 g = 20 + 30 * 2 && 1, 25 h = "abcd".length, 26 length = h + "abc".length, 27 i = "str" + "_i" 28} 29 30print(tsEnum2.a); 31print(tsEnum2.b); 32print(tsEnum2.e); 33print(tsEnum2.f); 34print(tsEnum2.g); 35print(tsEnum2.h); 36print(tsEnum2.length); 37print(tsEnum2.i); 38 39print(tsEnum2[33]); 40print(tsEnum2[45]); 41print(tsEnum2[tsEnum2.g]); 42print(tsEnum2["abcd".length]); 43print(tsEnum2[7]); 44print(tsEnum2["str_i"]);