@Override protected HotSwapCompilerPass create(final AbstractCompiler compiler) { List<Callback> sharedCallbacks = new ArrayList<Callback>(); if (options.checkSuspiciousCode) { sharedCallbacks.add(new CheckSuspiciousCode()); sharedCallbacks.add(new CheckDuplicateCase(compiler)); } if (options.enables(DiagnosticGroups.GLOBAL_THIS)) { sharedCallbacks.add(new CheckGlobalThis(compiler)); } if (options.enables(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT)) { sharedCallbacks.add(new CheckDebuggerStatement(compiler)); } return combineChecks(compiler, sharedCallbacks); }
@Override protected HotSwapCompilerPass create(final AbstractCompiler compiler) { List<Callback> sharedCallbacks = new ArrayList<>(); if (options.checkSuspiciousCode) { sharedCallbacks.add(new CheckSuspiciousCode()); sharedCallbacks.add(new CheckDuplicateCase(compiler)); } if (options.enables(DiagnosticGroups.GLOBAL_THIS)) { sharedCallbacks.add(new CheckGlobalThis(compiler)); } if (options.enables(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT)) { sharedCallbacks.add(new CheckDebuggerStatement(compiler)); } return combineChecks(compiler, sharedCallbacks); }
@Override protected CompilerPass create(AbstractCompiler compiler) { return new CombinedCompilerPass( compiler, ImmutableList.<Callback>of( new CheckDuplicateCase(compiler), new CheckEmptyStatements(compiler), new CheckEnums(compiler), new CheckJSDocStyle(compiler), new CheckJSDoc(compiler), new CheckMissingSemicolon(compiler), new CheckMissingSuper(compiler), new CheckPrimitiveAsObject(compiler), new CheckRequiresAndProvidesSorted(compiler), new CheckUnusedLabels(compiler), new CheckUselessBlocks(compiler), new ClosureCheckModule(compiler), new Es6SuperCheck(compiler))); } };
@Override protected CompilerPass create(AbstractCompiler compiler) { return new CombinedCompilerPass( compiler, ImmutableList.of( new CheckDuplicateCase(compiler), new CheckEmptyStatements(compiler), new CheckEnums(compiler), new CheckJSDocStyle(compiler), new CheckJSDoc(compiler), new CheckMissingSemicolon(compiler), new CheckSuper(compiler), new CheckPrimitiveAsObject(compiler), new ClosureCheckModule(compiler, compiler.getModuleMetadataMap()), new CheckNullabilityModifiers(compiler), new CheckRequiresAndProvidesSorted(compiler), new CheckSideEffects( compiler, /* report */ true, /* protectSideEffectFreeCode */ false), new CheckTypeImportCodeReferences(compiler), new CheckUnusedLabels(compiler), new CheckUselessBlocks(compiler))); }