1/* 2 * Copyright (c) 2024 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 16declare function print(arg:any):string; 17//aot: [trace] aot inline builtin: Object.is, caller function name:func_main_0@builtinObjectObject 18print(Object.is(1, 1)); //: true 19//aot: [trace] aot inline builtin: Object.is, caller function name:func_main_0@builtinObjectObject 20print(Object.is(1, 2)); //: false 21//aot: [trace] aot inline builtin: Object.is, caller function name:func_main_0@builtinObjectObject 22print(Object.is(1, "abc")); //: false 23//aot: [trace] aot inline builtin: Object.is, caller function name:func_main_0@builtinObjectObject 24print(Object.is(1, {})); //: false 25//aot: [trace] aot inline builtin: Object.getPrototypeOf, caller function name:func_main_0@builtinObjectObject 26print(Object.getPrototypeOf({})) //: [object Object] 27//aot: [trace] aot inline builtin: Object.getPrototypeOf, caller function name:func_main_0@builtinObjectObject 28print(Object.getPrototypeOf(1)) //: 0 29//aot: [trace] aot inline builtin: Object.getPrototypeOf, caller function name:func_main_0@builtinObjectObject 30print(Object.getPrototypeOf(true)) //: false 31let proto = {name: "create"}; 32//aot: [trace] aot inline builtin: Object.create, caller function name:func_main_0@builtinObjectObject 33print(Object.create(proto).name); //: create 34//aot: [trace] aot call builtin: Object.create, caller function name:func_main_0@builtinObjectObject 35print(Object.create(proto, { 36 name: { 37 value: "new create", 38 enumerable: false, 39 writable: true, 40 configurable: true, 41 }, 42}).name); //: new create 43try { 44 //aot: [trace] aot inline builtin: Object.create, caller function name:func_main_0@builtinObjectObject 45 Object.create(undefined); 46} catch(e) { 47 print(e instanceof TypeError); //: true 48} 49let isProto = {}; 50//aot: [trace] aot inline builtin: Object.prototype.isPrototypeOf, caller function name:func_main_0@builtinObjectObject 51print(isProto.isPrototypeOf(isProto)); //: false 52//aot: [trace] aot inline builtin: Object.prototype.isPrototypeOf, caller function name:func_main_0@builtinObjectObject 53print(Object.prototype.isPrototypeOf(isProto)); //: true 54let hasOwnProp = {a: 123}; 55//aot: [trace] aot inline builtin: Object.prototype.hasOwnProperty, caller function name:func_main_0@builtinObjectObject 56print(hasOwnProp.hasOwnProperty("a")); //: true 57//aot: [trace] aot inline builtin: Object.prototype.hasOwnProperty, caller function name:func_main_0@builtinObjectObject 58print(hasOwnProp.hasOwnProperty("b")); //: false 59