1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14.language ECMAScript 15 16slotNum = 0x0 17.function any .C(any a0, any a1, any a2) { 18label_1: 19label_0: 20 lda a2 21 return 22label_2: 23} 24 25slotNum = 0x3 26.function any .ccc(any a0, any a1, any a2) { 27label_1: 28label_0: 29 tryldglobalbyname 0x0, print 30 sta v0 31 lda.str ccc 32 sta v1 33 lda v0 34 callarg1 0x1, v1 35 ldundefined 36 returnundefined 37label_2: 38} 39 40slotNum = 0x3 41.function any .classTest(any a0, any a1, any a2) { 42label_1: 43label_0: 44 ldhole 45 sta v0 46 defineclasswithbuffer 0x0, .C, _1, 0x0, v0 47 ldobjbyname 0x1, prototype 48 ldundefined 49 returnundefined 50label_2: 51} 52 53slotNum = 0x1 54.function any .func_main_0(any a0, any a1, any a2) { 55label_1: 56label_0: 57 definefunc 0x0, .classTest, 0x0 58 ldundefined 59 returnundefined 60label_2: 61} 62 63slotNum = 0x3 64.function any .name(any a0, any a1, any a2) { 65label_1: 66label_0: 67 tryldglobalbyname 0x0, print 68 sta v0 69 lda.str name 70 sta v1 71 lda v0 72 callarg1 0x1, v1 73 ldundefined 74 returnundefined 75label_2: 76} 77 78 79