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 16.function any .C(any a0, any a1, any a2) { 17label_1: 18label_0: 19 lda a2 20 return 21label_2: 22} 23 24.function any .ccc(any a0, any a1, any a2) { 25label_1: 26label_0: 27 tryldglobalbyname 0x0, print 28 sta v0 29 lda.str ccc 30 sta v1 31 lda v0 32 callarg1 0x1, v1 33 ldundefined 34 returnundefined 35label_2: 36} 37 38.function any .classTest(any a0, any a1, any a2) { 39label_1: 40label_0: 41 ldhole 42 sta v0 43 defineclasswithbuffer 0x0, .C, _1, 0x0, v0 44 ldobjbyname 0x1, prototype 45 ldundefined 46 returnundefined 47label_2: 48} 49 50.function any .func_main_0(any a0, any a1, any a2) { 51label_1: 52label_0: 53 definefunc 0x0, .classTest, 0x0 54 ldundefined 55 returnundefined 56label_2: 57} 58 59.function any .name(any a0, any a1, any a2) { 60label_1: 61label_0: 62 tryldglobalbyname 0x0, print 63 sta v0 64 lda.str name 65 sta v1 66 lda v0 67 callarg1 0x1, v1 68 ldundefined 69 returnundefined 70label_2: 71} 72 73 74