public void handle(CompilerOptions compilerOptions) {
   compilerOptions.setCheckEventfulObjectDisposalPolicy(AGGRESSIVE);
   compilerOptions.assumeStrictThis();
   compilerOptions.setCheckMissingReturn(CheckLevel.ERROR);
   compilerOptions.setAggressiveVarCheck(CheckLevel.ERROR);
   compilerOptions.setCheckDeterminism(true);
   compilerOptions.setBrokenClosureRequiresLevel(CheckLevel.ERROR);
   compilerOptions.setCheckTypes(true);
   compilerOptions.setInferConst(true);
   CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(compilerOptions);
   CompilationLevel.ADVANCED_OPTIMIZATIONS.setTypeBasedOptimizationOptions(compilerOptions);
 }
Ejemplo n.º 2
0
  @VisibleForTesting
  static CompilerOptions getCompilerOptions() {
    CompilerOptions options = new CompilerOptions();

    DependencyOptions deps = new DependencyOptions();
    deps.setDependencySorting(true);
    options.setDependencyOptions(deps);

    options.setIdeMode(true);
    options.setCheckSuspiciousCode(true);
    options.setCheckSymbols(true);
    options.setCheckTypes(true);
    options.setClosurePass(true);
    options.setPreserveGoogRequires(true);

    options.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.ERROR);

    return options;
  }
Ejemplo n.º 3
0
 @Override
 void apply(CompilerOptions options, boolean value) {
   options.setCheckTypes(value);
 }