From 0e0b05947e70a95d27d308af864e81d7029b040f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 13 Feb 2021 18:14:19 +0100 Subject: [PATCH] AS1/2 direct editation - double negation does not get lost --- CHANGELOG.md | 2 +- .../flash/action/parser/script/ActionSourceGenerator.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36e365edd..986c8e961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. - Collapsing tag tree on SWF reload - #1339 AS1/2 direct editation - targetPath as an expression - #1467 AS1/2 direct editation - allow new Number call -- #1489 AS1/2 direct editation - reversed conditions in if +- #1489 AS1/2 direct editation - reversed negations - #1489 AS1/2 direct editation - for in loop ## [13.0.3] - 2021-02-12 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index 518336ce4..588d138e9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -136,8 +136,8 @@ public class ActionSourceGenerator implements SourceGenerator { private List generateIf(SourceGeneratorLocalData localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) throws CompilationException { List ret = new ArrayList<>(); - if (expression instanceof Inverted) { - ret.addAll(((Inverted) expression).invert(null).toSource(localData, this)); + if (expression instanceof NotItem) { + ret.addAll(expression.value.toSource(localData, this)); } else { ret.addAll(expression.toSource(localData, this)); ret.add(new ActionNot()); @@ -418,9 +418,9 @@ public class ActionSourceGenerator implements SourceGenerator { @Override public List generate(SourceGeneratorLocalData localData, NotItem item) throws CompilationException { - if (item.value instanceof NotItem) { + /*if (item.value instanceof NotItem) { return item.value.value.toSource(localData, this); - } + }*/ List ret = new ArrayList<>(); ret.addAll(item.getOriginal().toSource(localData, this)); ret.add(new ActionNot());