Fixed #2202 AS2 return in constructor does not take a value

This commit is contained in:
Jindra Petřík
2024-08-05 11:17:25 +02:00
parent 163a0e00d2
commit ffda86028d
6 changed files with 66 additions and 0 deletions
@@ -208,4 +208,29 @@ public class ActionScript2ClassesTest extends ActionScript2TestBase {
+ " com.jpexs.flash.test.testcases.TestSetterGetter.mystvar = 6;\n"
+ " }");
}
@Test
public void testReturnInConstructor() {
compareSrc("TestReturnInConstructor", " function TestReturnInConstructor()\n"
+ " {\n"
+ " var _loc1_ = 3;\n"
+ " if(_loc1_ == 3)\n"
+ " {\n"
+ " trace(\"A\");\n"
+ " return;\n"
+ " }\n"
+ " trace(\"B\");\n"
+ " }\n"
+ " function func()\n"
+ " {\n"
+ " var _loc1_ = 3;\n"
+ " if(_loc1_ == 3)\n"
+ " {\n"
+ " trace(\"A\");\n"
+ " return undefined;\n"
+ " }\n"
+ " trace(\"B\");\n"
+ " return 5;\n"
+ " }");
}
}