diff --git a/CHANGELOG.md b/CHANGELOG.md index 8483f1d19..38e34efd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. - [#1937] AS3 - declarations vs null - [#1458] Quick find bar overlaying horizontal scrollbar - [#1842] AS1/2 Better handling obfuscated code, for..in +- [#1842] AS1/2 use parenthesis when initObject has nonstring keys ## [18.3.2] - 2023-01-10 ### Removed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java index c6e60c07a..075ae910b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java @@ -63,8 +63,15 @@ public class InitObjectActionItem extends ActionItem { if (i < values.size() - 1) { writer.append(","); } - //AS1/2 does not allow quotes in name here - writer.append(IdentifiersDeobfuscation.printIdentifier(false, names.get(i).toStringNoQuotes(localData))); + //AS1/2 does not allow quotes in name here + if ((names.get(i) instanceof DirectValueActionItem) + &&(((DirectValueActionItem)names.get(i)).isSimpleValue())) { + writer.append(IdentifiersDeobfuscation.printIdentifier(false, names.get(i).toStringNoQuotes(localData))); + } else { + writer.append("("); + names.get(i).appendTo(writer, localData); + writer.append(")"); + } writer.append(":"); if (values.get(i) instanceof TernarOpItem) { //Ternar operator contains ":" writer.append("(");