diff --git a/trunk/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java b/trunk/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java index 320dcb5a8..5b442f804 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java @@ -81,4 +81,19 @@ public class ActionScript2ParserTest extends ActionStript2TestBase { " }\n" + "}"); } + + @Test + private void testAS2Parse5() { + parseAS2( + "if(!test.T1)\n" + + "{\n" + + " test.T1 = function()\n" + + " {\n" + + " super();\n" + + " }.Initialize = function(obj)\n" + + " {\n" + + " var x = 1;\n" + + " };\n" + + "}"); + } } diff --git a/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java b/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java index f2c378091..4b2f8ceba 100644 --- a/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java @@ -88,7 +88,7 @@ public class RecompileTest { HilightedTextWriter writer = new HilightedTextWriter(new CodeFormatting(), false); Action.actionsToSource(asm, asm.getActions(), asm.toString()/*FIXME?*/, writer); String as = writer.toString(); - asm.removePrefixAndSuffix(as); + as = asm.removePrefixAndSuffix(as); ActionScriptParser par = new ActionScriptParser(); try { asm.setActions(par.actionsFromString(as)); @@ -98,7 +98,7 @@ public class RecompileTest { writer = new HilightedTextWriter(new CodeFormatting(), false); Action.actionsToSource(asm, asm.getActions(), asm.toString()/*FIXME?*/, writer); String as2 = writer.toString(); - asm.removePrefixAndSuffix(as2); + as2 = asm.removePrefixAndSuffix(as2); try { asm.setActions(par.actionsFromString(as2)); } catch (ParseException ex) { @@ -107,7 +107,7 @@ public class RecompileTest { writer = new HilightedTextWriter(new CodeFormatting(), false); Action.actionsToSource(asm, asm.getActions(), asm.toString()/*FIXME?*/, writer); String as3 = writer.toString(); - asm.removePrefixAndSuffix(as3); + as3 = asm.removePrefixAndSuffix(as3); if (!as3.equals(as2)) { fail("ActionScript is diffrent: " + item.getSwf().getShortFileName() + "/" + item.toString()); }