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 */ 15declare function print(str:any):string; 16 17// case1: CREATEOBJECTWITHEXCLUDEDKEYS 18const o4 : {} = { 19 get c() : {}{ 20 let {...v3} = t12() 21 }, 22} 23 24// case2: ProcessSnapshotConstantPool 25var m = { 26 get a() { 27 function f() { 28 return 1 29 } 30 }, 31 "a": "hello" 32} 33 34// case3: last label equal bcLast 35function f() {} 36function f1() { 37 return 38 try { 39 f() 40 } catch(e) { 41 } 42} 43 44// case4: GetDeps 45function f2() { 46 try { 47 return 48 } catch(e15) { 49 } 50 while(1) {} 51} 52 53// case5: asan check 54function f59() : number[] {} 55class C60 extends f59 {} 56const v75 : number = new C60() 57 58// case6: NewJSError Stack Overflow 59function f230():string { 60 const v292:number = -2; 61 const v303:number[] = [1000,-1970969808,536870887,257,17933,11,1024]; 62 try { new v292(64, ...v303, ...v303, ...v303, ...v303); } catch (e) {} 63 return "bigint"; 64} 65for (let v316:number = 0; v316 < 5; v316++) { 66 f230(); 67} 68 69// case7: extendClassType check 70const v1455:{} = ("boolean")[Symbol.iterator]; 71try { 72 class C1723 extends v1455 { 73 [a1718]; 74 static [v1705] = a1719; 75 } 76} catch (e) {} 77 78// case8: stackmapNum % 2 79let v39:any = 129 || C3; 80Math.sign("12"); 81v39++; 82 83// case9: this branch is unreachable 84let v:number = []; 85print(Math.abs(--v)); 86print(v); 87let u:number[] = []; 88print(--u); 89 90// case10: value input does not match (expected I64 actual I32) 91for (let v0 = 0; v0 < 5; v0++) { 92 try {BigInt.asIntN(v0, v0); } catch (e) {} 93} 94 95class C1 { 96 constructor(a3, a4) { 97 ("split")[3][0]; 98 } 99} 100new C1("split", C1); 101new C1(); 102 103print("compiler success");