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
34print(Object.create(proto, {
35    name: {
36        value: "new create",
37        enumerable: false,
38        writable: true,
39        configurable: true,
40    },
41}).name); //: new create
42try {
43    //aot: [trace] aot inline builtin: Object.create, caller function name:func_main_0@builtinObjectObject
44    Object.create(undefined);
45} catch(e) {
46    print(e instanceof TypeError); //: true
47}
48let isProto = {};
49//aot: [trace] aot inline builtin: Object.prototype.isPrototypeOf, caller function name:func_main_0@builtinObjectObject
50print(isProto.isPrototypeOf(isProto)); //: false
51//aot: [trace] aot inline builtin: Object.prototype.isPrototypeOf, caller function name:func_main_0@builtinObjectObject
52print(Object.prototype.isPrototypeOf(isProto)); //: true
53let hasOwnProp = {a: 123};
54//aot: [trace] aot inline builtin: Object.prototype.hasOwnProperty, caller function name:func_main_0@builtinObjectObject
55print(hasOwnProp.hasOwnProperty("a")); //: true
56//aot: [trace] aot inline builtin: Object.prototype.hasOwnProperty, caller function name:func_main_0@builtinObjectObject
57print(hasOwnProp.hasOwnProperty("b")); //: false
58