Skip to content

Commit 1726d24

Browse files
committed
tests: Add tests for calling undefined AVM2 function
1 parent e1b2471 commit 1726d24

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

tests/tests/swfs/avm2/function_call/Test.as

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,32 @@ function testfunc(v1, v2, v3) {
88
trace(v3);
99
}
1010

11-
testfunc("arg1", "arg2", "arg3");
11+
trace('// testfunc("arg1", "arg2", "arg3");');
12+
testfunc("arg1", "arg2", "arg3");
13+
trace("");
14+
15+
// Errors
16+
var o = undefined;
17+
trace('// o();');
18+
try {
19+
o();
20+
} catch(e:*) {
21+
trace("Error: " + e.errorID);
22+
}
23+
24+
trace('// o.foo();');
25+
o = {};
26+
try {
27+
o.foo();
28+
} catch(e:*) {
29+
trace("Error: " + e.errorID);
30+
}
31+
trace("");
32+
33+
34+
trace('// o["foo"]();');
35+
try {
36+
o["foo"]();
37+
} catch(e:*) {
38+
trace("Error: " + e.errorID);
39+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// testfunc("arg1", "arg2", "arg3");
12
arg1
23
arg2
34
arg3
5+
6+
// o();
7+
Error: 1006
8+
// o.foo();
9+
Error: 1006
10+
11+
// o["foo"]();
12+
Error: 1006
772 Bytes
Binary file not shown.
666 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)