-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Today, the file overrides closure compiler's CommandLineRunner and passes in special options that are neither available as flags nor included in the default compilation_level settings of SIMPLE_OPTIMIZATIONS or ADVANCED.
| @Override protected CompilerOptions createOptions() { | |
| if (typecheck_only) { | |
| return createTypeCheckingOptions(); | |
| } | |
| CompilerOptions options = super.createOptions(); | |
| options.setCollapsePropertiesLevel(CompilerOptions.PropertyCollapseLevel.ALL); | |
| options.setDevirtualizeMethods(true); | |
| options.setExtractPrototypeMemberDeclarations(true); | |
| options.setSmartNameRemoval(true); | |
| options.optimizeCalls = true; | |
| // Have to turn this off because we cannot know whether sub classes | |
| // might override a method. In the future this might be doable | |
| // with using a more complete extern file instead. | |
| options.setRemoveUnusedPrototypeProperties(false); | |
| options.setComputeFunctionSideEffects(false); | |
| // Property renaming. Relies on AmpCodingConvention to be safe. | |
| options.setRenamingPolicy(VariableRenamingPolicy.ALL, | |
| PropertyRenamingPolicy.ALL_UNQUOTED); | |
| options.setDisambiguatePrivateProperties(true); | |
| options.setGeneratePseudoNames(pseudo_names); | |
| return options; | |
| } |
In order to remove this file, we'd have to either make do without the special options, or add babel transforms that make them unnecessary, or convince the closure team to provide flags that activate the options.
Reactions are currently unavailable