From ec5d5f64017a1081450c1a3bcd64277e35791f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 28 Nov 2021 17:52:23 +0100 Subject: [PATCH] Fixed AS1/2 - parenthesis around callfunction --- CHANGELOG.md | 1 + .../flash/action/model/CallFunctionActionItem.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e41269b28..d9e0463c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ All notable changes to this project will be documented in this file. - AS1/2 - direct editation - try..finally without catch clause - AS1/2 - GotoFrame2 - scene bias is first - AS1/2 - direct editation - gotoAndPlay/Stop with scenebias +- AS1/2 - parenthesis around callfunction ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java index 5c0e52a7e..0684c17fe 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -74,7 +74,13 @@ public class CallFunctionActionItem extends ActionItem { functionName.toStringNoQuotes(writer, localData); } } else { + if (functionName.getPrecedence() > getPrecedence()) { + writer.append("("); + } functionName.appendTry(writer, localData); + if (functionName.getPrecedence() > getPrecedence()) { + writer.append(")"); + } } writer.spaceBeforeCallParenthesies(arguments.size()); writer.append("(");