third_party/closure-compiler/src/test/com/google/javascript/jscomp/IntegrationTest.java
// Tests that unused classes are removed, even if they are passed to $jscomp.inherits.
Tests that unused classes are removed, even if they are passed to $jscomp.inherits.
Tests that unused classes are removed even if they are passed to $jscomp . inherits .
private void
      testES6UnusedClassesAreRemoved(CodingConvention convention) {
    CompilerOptions options = createCompilerOptions();
    options.setLanguageIn(LanguageMode.ECMASCRIPT_2015);
    options.setLanguageOut(LanguageMode.ECMASCRIPT3);
    options.setCodingConvention(convention);
    CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
    Compiler compiler = compile(options, LINE_JOINER.join(
        "class Base {}",
        "class Sub extends Base {}",
        "alert(1);"));
    String result = compiler.toSource(compiler.getJsRoot());
    assertThat(result).isEqualTo("alert(1)");
  }
private void testES6UnusedClassesAreRemoved ( CodingConvention convention ) { CompilerOptions options = createCompilerOptions ( ) ; options . setLanguageIn ( LanguageMode . ECMASCRIPT_2015 ) ; options . setLanguageOut ( LanguageMode . ECMASCRIPT3 ) ; options . setCodingConvention ( convention ) ; CompilationLevel . ADVANCED_OPTIMIZATIONS . setOptionsForCompilationLevel ( options ) ; Compiler compiler = compile ( options , LINE_JOINER . join ( "class Base {}" , "class Sub extends Base {}" , "alert(1);" ) ) ; String result = compiler . toSource ( compiler . getJsRoot ( ) ) ; assertThat ( result ) . isEqualTo ( "alert(1)" ) ; }
Tests that unused classes are removed, even if they are passed to $jscomp.inherits.
Tests that unused classes are removed even if they are passed to $jscomp . inherits .