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("(");