From 1d150c0442874571aaaa7eaa72dfc16f5514b182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 26 Nov 2021 19:33:50 +0100 Subject: [PATCH] Fixed AS2 - class detection of top level classes --- CHANGELOG.md | 1 + .../decompiler/flash/action/ActionScript2ClassDetector.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 982db206f..33eb47647 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - New version dialog error when no main window available - AS1/2 direct editation - commands as expressions - AS1/2 direct editation - delete operator on anything +- AS2 - class detection of top level classes ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java index fc9f9cbfd..0d7ff8728 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java @@ -445,6 +445,10 @@ public class ActionScript2ClassDetector { if (memPath == null) { throw new AssertException("Invalid pathsource"); } + //remove _global if it's there - happens for classes in global package + if (memPath.size() > 0 && "_global".equals(memPath.get(0))) { + memPath.remove(0); + } if (!classNamePath.equals(memPath)) { throw new AssertException("Invalid path of setmember:" + String.join(".", memPath)); }