Fixed: AS3 inner functions scope (setslot/getslot)

This commit is contained in:
Jindra Petřík
2021-02-09 18:52:25 +01:00
parent a97f57c40f
commit b7ee8d73ca
18 changed files with 60 additions and 32 deletions
@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.xfl;
import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler;
@@ -2454,7 +2455,7 @@ public class XFLConverter {
MethodBody constructorBody = abc.findBody(constructorMethodIndex);
try {
if (constructorBody.convertedItems == null) {
constructorBody.convert(new ConvertData(), "??", ScriptExportMode.AS, true, constructorMethodIndex, pack.scriptIndex, classIndex, abc, null, new ScopeStack(pack.scriptIndex), GraphTextWriter.TRAIT_INSTANCE_INITIALIZER, new NulWriter(), new ArrayList<>(), new ArrayList<>(), true);
constructorBody.convert(new ConvertData(), "??", ScriptExportMode.AS, true, constructorMethodIndex, pack.scriptIndex, classIndex, abc, null, new ScopeStack(), GraphTextWriter.TRAIT_INSTANCE_INITIALIZER, new NulWriter(), new ArrayList<>(), new ArrayList<>(), true);
}
Map<Integer, Integer> frameToTraitMultiname = new HashMap<>();
@@ -2517,7 +2518,7 @@ public class XFLConverter {
MethodBody frameBody = abc.findBody(methodIndex);
StringBuilder scriptBuilder = new StringBuilder();
frameBody.convert(new ConvertData(), "??", ScriptExportMode.AS, false, methodIndex, pack.scriptIndex, classIndex, abc, methodTrait, new ScopeStack(pack.scriptIndex), 0, new NulWriter(), new ArrayList<>(), new ArrayList<>(), true);
frameBody.convert(new ConvertData(), "??", ScriptExportMode.AS, false, methodIndex, pack.scriptIndex, classIndex, abc, methodTrait, new ScopeStack(), 0, new NulWriter(), new ArrayList<>(), new ArrayList<>(), true);
StringBuilderTextWriter writer = new StringBuilderTextWriter(Configuration.getCodeFormatting(), scriptBuilder);
frameBody.toString("??", ScriptExportMode.AS, abc, methodTrait, writer, new ArrayList<>());