diff --git a/CHANGELOG.md b/CHANGELOG.md index 93636f06d..b1bc45849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - AS1/2 Direct editation mark line on error - Collapsing tag tree on SWF reload - #1339 AS1/2 direct editation - targetPath as an expression +- #1467 AS1/2 direct editation - allow new Number call ## [13.0.3] - 2021-02-12 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java index 342ea974c..7c0c4dae4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java @@ -1764,7 +1764,13 @@ public class ActionScript2Parser { break; case NEW: GraphTargetItem newvar = expressionPrimary(false, inFunction, inMethod, false, variables, functions);//variable(inFunction, inMethod, variables, functions); - if (newvar instanceof CallMethodActionItem) { + if (newvar instanceof ToNumberActionItem) { + List args = new ArrayList<>(); + if (((ToNumberActionItem) newvar).value != null) { + args.add(((ToNumberActionItem) newvar).value); + } + ret = new NewObjectActionItem(null, null, pushConst("Number"), args); + } else if (newvar instanceof CallMethodActionItem) { CallMethodActionItem ca = (CallMethodActionItem) newvar; ret = new NewMethodActionItem(null, null, ca.scriptObject, ca.methodName, ca.arguments); } else if (newvar instanceof CallFunctionActionItem) {