• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16let a = "123";
17// callarg0
18try {
19    a();
20} catch (e) {
21    print(e.message);
22    print(e.stack);
23}
24
25// callarg1
26try {
27    a(1);
28} catch (e) {
29    print(e.message);
30    print(e.stack);
31}
32
33// callargs2
34try {
35    a(1, "a");
36} catch (e) {
37    print(e.message);
38    print(e.stack);
39}
40
41// callargs3
42try {
43    a(1, "a", 2);
44} catch (e) {
45    print(e.message);
46    print(e.stack);
47}
48
49// callrange
50try {
51    a(1, "a", 2, 3);
52} catch (e) {
53    print(e.message);
54    print(e.stack);
55}
56
57// wide callrange
58try {
59    a(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
60        11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
61        21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
62        31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
63        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
64        51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
65        61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
66        71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
67        81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
68        91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
69        101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
70        111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
71        121, 122, 123, 124, 125, 126, 127, 128);
72} catch (e) {
73    print(e.message);
74    print(e.stack);
75}
76