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 16class Base { 17 constructor(a, b) { 18 this.a_ = a; 19 this.b_ = b; 20 } 21}; 22 23class Derived extends Base { 24}; 25 26class Derived1 extends Base { 27 constructor(a, b) { 28 super(a, b); 29 } 30}; 31 32 33function Test() { 34 var b = new Base("sun", 100); 35 var d = new Derived("zibo", 200); 36 var d1 = new Derived1("zibobo", 300); 37 print(b.a_); 38 print(b.b_); 39 print(d.a_); 40 print(d.b_); 41 print(d1.a_); 42 print(d1.b_); 43} 44 45Test(); 46ArkTools.jitCompileAsync(Test); 47print(ArkTools.waitJitCompileFinish(Test)); 48Test();