Allow the renaming policies to be disabled by a flag.
Closes
@@ -790,6 +790,11 @@ public class CommandLineRunner extends
)
private String packageJsonEntryNames = null;
+ @Option(name = "--renaming",
+ handler = BooleanOptionHandler.class,
+ usage = "Disables variable renaming. Cannot be used with ADVANCED optimizations.")
+ private boolean renaming = true;
+
@Argument
private List<String> arguments = new ArrayList<>();
private final CmdLineParser parser;
@@ -1559,6 +1564,12 @@ public class CommandLineRunner extends
}
}
+ if (!flags.renaming
+ && flags.compilationLevelParsed == CompilationLevel.ADVANCED_OPTIMIZATIONS) {
+ reportError("ERROR - renaming cannot be disabled when ADVANCED_OPTMIZATIONS is used.");
+ runCompiler = false;
+ }
+
getCommandLineConfig()
.setPrintTree(flags.printTree)
.setPrintAst(flags.printAst)
@@ -1800,6 +1811,11 @@ public class CommandLineRunner extends
}
}
+ if (!flags.renaming) {
+ options.setVariableRenaming(VariableRenamingPolicy.OFF);
+ options.setPropertyRenaming(PropertyRenamingPolicy.OFF);
+ }
+
return options;
}
