Remove -XenableClosureCompiler.

Removes the integrated closure compiler pass. This feature was
experimental and most of the rough edges where never completed, e.g.
sourcemapping.

The GWT output can still be processed by the closure compiler by
manually invoking the closure compiler on GWTs output.

Change-Id: Ifd8773db86e5de23a490a6f5b3d7066c911fe219
diff --git a/dev/build.xml b/dev/build.xml
index a864a2b..a89fc4f 100755
--- a/dev/build.xml
+++ b/dev/build.xml
@@ -70,7 +70,6 @@
           <include name="icu4j/50.1.1/icu4j.jar"/>
           <include name="jetty/jetty-9.2.14.v20151106/jetty-all-9.2.14.v20151106.jar"/>
           <include name="gson/gson-2.6.2.jar"/>
-          <include name="jscomp/20160315/compiler-rebased.jar"/>
           <include name="jscomp/20160315/sourcemap-rebased.jar"/>
           <include name="jsr305/jsr305.jar"/>
           <include name="protobuf/protobuf-2.5.0/protobuf-java-rebased-2.5.0.jar"/>
@@ -129,7 +128,6 @@
           <zipfileset
               src="${gwt.tools.lib}/jetty/jetty-9.2.14.v20151106/jetty-all-9.2.14.v20151106.jar"/>
           <zipfileset src="${gwt.tools.lib}/gson/gson-2.6.2.jar"/>
-          <zipfileset src="${gwt.tools.lib}/jscomp/20160315/compiler-rebased.jar"/>
           <zipfileset src="${gwt.tools.lib}/jscomp/20160315/sourcemap-rebased.jar"/>
           <zipfileset src="${gwt.tools.lib}/jsr305/jsr305.jar"/>
           <zipfileset
@@ -215,7 +213,6 @@
         <pathelement
             location="${gwt.tools.lib}/guava/guava-19.0/guava-19.0-rebased.jar"/>
         <pathelement location="${gwt.tools.lib}/gson/gson-2.6.2.jar"/>
-        <pathelement location="${gwt.tools.lib}/jscomp/20160315/compiler-rebased.jar"/>
         <pathelement location="${gwt.tools.lib}/jscomp/20160315/sourcemap-rebased.jar"/>
         <pathelement location="${gwt.tools.lib}/json/android-sdk-19.1/json-android-rebased.jar"/>
         <pathelement location="${gwt.tools.lib}/jsr305/jsr305.jar"/>
diff --git a/dev/codeserver/java/com/google/gwt/dev/codeserver/CompilerOptionsImpl.java b/dev/codeserver/java/com/google/gwt/dev/codeserver/CompilerOptionsImpl.java
index 72139f4..16d01d7 100644
--- a/dev/codeserver/java/com/google/gwt/dev/codeserver/CompilerOptionsImpl.java
+++ b/dev/codeserver/java/com/google/gwt/dev/codeserver/CompilerOptionsImpl.java
@@ -170,11 +170,6 @@
   }
 
   @Override
-  public boolean isClosureCompilerEnabled() {
-    return false;
-  }
-
-  @Override
   public boolean isCompilerMetricsEnabled() {
     return false;
   }
diff --git a/dev/codeserver/java/com/google/gwt/dev/codeserver/UnmodifiableCompilerOptions.java b/dev/codeserver/java/com/google/gwt/dev/codeserver/UnmodifiableCompilerOptions.java
index 5156a51..ca27d67 100644
--- a/dev/codeserver/java/com/google/gwt/dev/codeserver/UnmodifiableCompilerOptions.java
+++ b/dev/codeserver/java/com/google/gwt/dev/codeserver/UnmodifiableCompilerOptions.java
@@ -50,11 +50,6 @@
   }
 
   @Override
-  public void setClosureCompilerEnabled(boolean enabled) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
   public void setClusterSimilarFunctions(boolean enabled) {
     throw new UnsupportedOperationException();
   }
diff --git a/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java b/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java
index 7d40137..b7d34ab 100644
--- a/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java
+++ b/dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java
@@ -33,7 +33,6 @@
 import com.google.gwt.dev.util.arg.ArgHandlerDraftCompile;
 import com.google.gwt.dev.util.arg.ArgHandlerDumpSignatures;
 import com.google.gwt.dev.util.arg.ArgHandlerEnableAssertions;
-import com.google.gwt.dev.util.arg.ArgHandlerEnableClosureCompiler;
 import com.google.gwt.dev.util.arg.ArgHandlerFragmentCount;
 import com.google.gwt.dev.util.arg.ArgHandlerFragmentMerge;
 import com.google.gwt.dev.util.arg.ArgHandlerGenDir;
@@ -75,7 +74,6 @@
     registerHandler(new ArgHandlerDraftCompile(options));
     registerHandler(new ArgHandlerDumpSignatures());
     registerHandler(new ArgHandlerEnableAssertions(options));
-    registerHandler(new ArgHandlerEnableClosureCompiler(options));
     registerHandler(new ArgHandlerFragmentCount(options));
     registerHandler(new ArgHandlerFragmentMerge(options));
     registerHandler(new ArgHandlerGenDir(options));
diff --git a/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java b/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java
index bea0d6c..5a9a969 100644
--- a/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java
+++ b/dev/core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java
@@ -135,11 +135,6 @@
   }
 
   @Override
-  public boolean isClosureCompilerEnabled() {
-    return jjsOptions.isClosureCompilerEnabled();
-  }
-
-  @Override
   public boolean isCompilerMetricsEnabled() {
     return jjsOptions.isCompilerMetricsEnabled();
   }
@@ -214,11 +209,6 @@
   }
 
   @Override
-  public void setClosureCompilerEnabled(boolean enabled) {
-    jjsOptions.setClosureCompilerEnabled(enabled);
-  }
-
-  @Override
   public void setClusterSimilarFunctions(boolean enabled) {
     jjsOptions.setClusterSimilarFunctions(enabled);
   }
diff --git a/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java b/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java
index 064770e..210d020 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java
@@ -21,7 +21,6 @@
 import com.google.gwt.dev.util.arg.OptionClusterSimilarFunctions;
 import com.google.gwt.dev.util.arg.OptionDisableClassMetadata;
 import com.google.gwt.dev.util.arg.OptionEnableAssertions;
-import com.google.gwt.dev.util.arg.OptionEnableClosureCompiler;
 import com.google.gwt.dev.util.arg.OptionFragmentCount;
 import com.google.gwt.dev.util.arg.OptionFragmentsMerge;
 import com.google.gwt.dev.util.arg.OptionGenerateJsInteropExports;
@@ -48,13 +47,10 @@
  */
 public interface JJSOptions extends OptionOptimize,
     OptionClusterSimilarFunctions, OptionIncrementalCompile, OptionDisableClassMetadata,
-    OptionEnableAssertions, OptionInlineLiteralParameters,
-    OptionOptimizeDataflow, OptionRunAsyncEnabled, OptionScriptStyle, OptionSoycEnabled,
-    OptionSoycDetailed, OptionJsonSoycEnabled, OptionOrdinalizeEnums,
-    OptionRemoveDuplicateFunctions, OptionStrict,
-    OptionSoycHtmlDisabled, OptionEnableClosureCompiler,
-    OptionFragmentsMerge, OptionFragmentCount, OptionSourceLevel, OptionNamespace,
-    OptionCheckedMode, OptionGenerateJsInteropExports, OptionUseDetailedTypeIds,
-    OptionAllowJDTConstantInlining, OptionMethodNameDisplayMode,
-    OptionClosureFormattedOutput {
+    OptionEnableAssertions, OptionInlineLiteralParameters, OptionOptimizeDataflow,
+    OptionRunAsyncEnabled, OptionScriptStyle, OptionSoycEnabled, OptionSoycDetailed,
+    OptionJsonSoycEnabled, OptionOrdinalizeEnums, OptionRemoveDuplicateFunctions, OptionStrict,
+    OptionSoycHtmlDisabled, OptionFragmentsMerge, OptionFragmentCount, OptionSourceLevel,
+    OptionNamespace, OptionCheckedMode, OptionGenerateJsInteropExports, OptionUseDetailedTypeIds,
+    OptionAllowJDTConstantInlining, OptionMethodNameDisplayMode, OptionClosureFormattedOutput {
 }
diff --git a/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java b/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
index 657fbad..fe4a103 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
@@ -28,7 +28,6 @@
 public class JJSOptionsImpl implements JJSOptions, Serializable {
 
   private boolean addRuntimeChecks = false;
-  private boolean closureCompilerEnabled;
   private boolean clusterSimilarFunctions = true;
   private boolean incrementalCompile = false;
   private boolean compilerMetricsEnabled = false;
@@ -62,7 +61,6 @@
   public void copyFrom(JJSOptions other) {
     setAddRuntimeChecks(other.shouldAddRuntimeChecks());
     setClassMetadataDisabled(other.isClassMetadataDisabled());
-    setClosureCompilerEnabled(other.isClosureCompilerEnabled());
     setClusterSimilarFunctions(other.shouldClusterSimilarFunctions());
     setIncrementalCompileEnabled(other.isIncrementalCompileEnabled());
     setCompilerMetricsEnabled(other.isCompilerMetricsEnabled());
@@ -129,11 +127,6 @@
   }
 
   @Override
-  public boolean isClosureCompilerEnabled() {
-    return closureCompilerEnabled;
-  }
-
-  @Override
   public boolean isCompilerMetricsEnabled() {
     return compilerMetricsEnabled;
   }
@@ -188,11 +181,6 @@
   }
 
   @Override
-  public void setClosureCompilerEnabled(boolean enabled) {
-    closureCompilerEnabled = enabled;
-  }
-
-  @Override
   public void setClusterSimilarFunctions(boolean enabled) {
     clusterSimilarFunctions = enabled;
   }
diff --git a/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java b/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
index e15dd0a..1c9e4fc 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
@@ -127,7 +127,6 @@
 import com.google.gwt.dev.jjs.impl.codesplitter.ReplaceRunAsyncs;
 import com.google.gwt.dev.jjs.impl.gflow.DataflowOptimizer;
 import com.google.gwt.dev.js.BaselineCoverageGatherer;
-import com.google.gwt.dev.js.ClosureJsRunner;
 import com.google.gwt.dev.js.CoverageInstrumentor;
 import com.google.gwt.dev.js.DuplicateClinitRemover;
 import com.google.gwt.dev.js.EvalFunctionsAtTopScope;
@@ -654,23 +653,17 @@
       Permutation permutation, long startTimeMs, SizeBreakdown[] sizeBreakdowns,
       PermutationResult permutationResult) {
     CompilationMetricsArtifact compilationMetrics = null;
-    // TODO: enable this when ClosureCompiler is enabled
     if (options.isCompilerMetricsEnabled()) {
-      if (options.isClosureCompilerEnabled()) {
-        logger.log(TreeLogger.WARN, "Incompatible options: -XenableClosureCompiler and "
-            + "-XcompilerMetric; ignoring -XcompilerMetric.");
-      } else {
-        compilationMetrics = new CompilationMetricsArtifact(permutation.getId());
-        compilationMetrics.setCompileElapsedMilliseconds(
-            System.currentTimeMillis() - startTimeMs);
-        compilationMetrics.setElapsedMilliseconds(
-            System.currentTimeMillis() - ManagementFactory.getRuntimeMXBean().getStartTime());
-        compilationMetrics.setJsSize(sizeBreakdowns);
-        compilationMetrics.setPermutationDescription(permutation.getProperties().prettyPrint());
-        permutationResult.addArtifacts(Lists.newArrayList(
-            unifiedAst.getModuleMetrics(), unifiedAst.getPrecompilationMetrics(),
-            compilationMetrics));
-      }
+      compilationMetrics = new CompilationMetricsArtifact(permutation.getId());
+      compilationMetrics.setCompileElapsedMilliseconds(
+          System.currentTimeMillis() - startTimeMs);
+      compilationMetrics.setElapsedMilliseconds(
+          System.currentTimeMillis() - ManagementFactory.getRuntimeMXBean().getStartTime());
+      compilationMetrics.setJsSize(sizeBreakdowns);
+      compilationMetrics.setPermutationDescription(permutation.getProperties().prettyPrint());
+      permutationResult.addArtifacts(Lists.newArrayList(
+          unifiedAst.getModuleMetrics(), unifiedAst.getPrecompilationMetrics(),
+          compilationMetrics));
     }
     return compilationMetrics;
   }
@@ -680,27 +673,15 @@
       boolean isSourceMapsEnabled, SizeBreakdown[] sizeBreakdowns,
       List<JsSourceMap> sourceInfoMaps, PermutationResult permutationResult) {
     if (options.isJsonSoycEnabled()) {
-      // TODO: enable this when ClosureCompiler is enabled
-      if (options.isClosureCompilerEnabled()) {
-        logger.log(TreeLogger.WARN, "Incompatible options: -XenableClosureCompiler and "
-            + "-XjsonSoyc; ignoring -XjsonSoyc.");
-      } else {
-        // Is a super set of SourceMapRecorder.makeSourceMapArtifacts().
-        permutationResult.addArtifacts(EntityRecorder.makeSoycArtifacts(
-            permutationId, sourceInfoMaps, options.getSourceMapFilePrefix(),
-            jjsmap, sizeBreakdowns,
-            ((DependencyGraphRecorder) dependenciesAndRecorder.getRight()), jprogram));
-      }
+      // Is a super set of SourceMapRecorder.makeSourceMapArtifacts().
+      permutationResult.addArtifacts(EntityRecorder.makeSoycArtifacts(
+          permutationId, sourceInfoMaps, options.getSourceMapFilePrefix(),
+          jjsmap, sizeBreakdowns,
+          ((DependencyGraphRecorder) dependenciesAndRecorder.getRight()), jprogram));
     } else if (isSourceMapsEnabled) {
-      // TODO: enable this when ClosureCompiler is enabled
-      if (options.isClosureCompilerEnabled()) {
-        logger.log(TreeLogger.WARN, "Incompatible options: -XenableClosureCompiler and "
-            + "compiler.useSourceMaps=true; ignoring compiler.useSourceMaps=true.");
-      } else {
-        logger.log(TreeLogger.INFO, "Source Maps Enabled");
-        permutationResult.addArtifacts(SourceMapRecorder.exec(permutationId, sourceInfoMaps,
-            options.getSourceMapFilePrefix()));
-      }
+      logger.log(TreeLogger.INFO, "Source Maps Enabled");
+      permutationResult.addArtifacts(SourceMapRecorder.exec(permutationId, sourceInfoMaps,
+          options.getSourceMapFilePrefix()));
     }
   }
 
@@ -725,19 +706,11 @@
       List<JsSourceMap> sourceInfoMaps, PermutationResult permutationResult,
       CompilationMetricsArtifact compilationMetrics)
       throws IOException, UnableToCompleteException {
-    // TODO: enable this when ClosureCompiler is enabled
-    if (options.isClosureCompilerEnabled()) {
-      if (options.isSoycEnabled()) {
-        logger.log(TreeLogger.WARN, "Incompatible options: -XenableClosureCompiler and "
-            + "-compileReport; ignoring -compileReport.");
-      }
-    } else {
-      permutationResult.addArtifacts(makeSoycArtifacts(permutationId, js, sizeBreakdowns,
-          options.isSoycExtra() ? sourceInfoMaps : null, dependenciesAndRecorder.getLeft(),
-          jjsmap, internedLiteralByVariableName, unifiedAst.getModuleMetrics(),
-          unifiedAst.getPrecompilationMetrics(), compilationMetrics,
-          options.isSoycHtmlDisabled()));
-    }
+    permutationResult.addArtifacts(makeSoycArtifacts(permutationId, js, sizeBreakdowns,
+        options.isSoycExtra() ? sourceInfoMaps : null, dependenciesAndRecorder.getLeft(),
+        jjsmap, internedLiteralByVariableName, unifiedAst.getModuleMetrics(),
+        unifiedAst.getPrecompilationMetrics(), compilationMetrics,
+        options.isSoycHtmlDisabled()));
   }
 
   private void addSyntheticArtifacts(UnifiedAst unifiedAst, Permutation permutation,
@@ -774,14 +747,6 @@
     Event generateJavascriptEvent =
         SpeedTracerLogger.start(CompilerEventType.GENERATE_JAVASCRIPT);
 
-    boolean useClosureCompiler = options.isClosureCompilerEnabled();
-    if (useClosureCompiler) {
-      ClosureJsRunner runner = new ClosureJsRunner();
-      runner.compile(jprogram, jsProgram, jsFragments, options.getOutput());
-      generateJavascriptEvent.end();
-      return;
-    }
-
     for (int i = 0; i < jsFragments.length; i++) {
       DefaultTextOutput out = new DefaultTextOutput(!options.isIncrementalCompileEnabled() &&
           options.getOutput().shouldMinimize());
diff --git a/dev/core/src/com/google/gwt/dev/js/ClosureJsAst.java b/dev/core/src/com/google/gwt/dev/js/ClosureJsAst.java
deleted file mode 100644
index 0a437b0..0000000
--- a/dev/core/src/com/google/gwt/dev/js/ClosureJsAst.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.dev.js;
-
-import com.google.gwt.thirdparty.guava.common.base.Preconditions;
-import com.google.gwt.thirdparty.javascript.jscomp.AbstractCompiler;
-import com.google.gwt.thirdparty.javascript.jscomp.SourceAst;
-import com.google.gwt.thirdparty.javascript.jscomp.SourceFile;
-import com.google.gwt.thirdparty.javascript.rhino.InputId;
-import com.google.gwt.thirdparty.javascript.rhino.Node;
-
-/**
- * Maps the JavaScript AST to a Closure Compiler input source.
- */
-public class ClosureJsAst implements SourceAst {
-
-  private static final long serialVersionUID = 1L;
-
-  /*
-   * Root node of internal JS Compiler AST which represents the same source. In order to get the
-   * tree, getAstRoot() has to be called.
-   */
-  private Node root;
-  private final InputId inputId;
-
-  public ClosureJsAst(InputId inputId, Node root) {
-    Preconditions.checkNotNull(root);
-    this.inputId = inputId;
-    this.root = root;
-  }
-
-  @Override
-  public void clearAst() {
-    root = null;
-  }
-
-  @Override
-  public Node getAstRoot(AbstractCompiler compiler) {
-    return root;
-  }
-
-  @Override
-  public InputId getInputId() {
-    return inputId;
-  }
-
-  @Override
-  public SourceFile getSourceFile() {
-    return null;
-  }
-
-  public String getSourceName() {
-    return null;
-  }
-
-  @Override
-  public void setSourceFile(SourceFile file) {
-    throw new UnsupportedOperationException(
-        "ClosureJsAst cannot be associated with a SourceFile instance.");
-  }
-}
diff --git a/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java b/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java
deleted file mode 100644
index 60c8e04..0000000
--- a/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java
+++ /dev/null
@@ -1,836 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.dev.js;
-
-import com.google.gwt.dev.jjs.HasSourceInfo;
-import com.google.gwt.dev.jjs.SourceInfo;
-import com.google.gwt.dev.js.ast.HasName;
-import com.google.gwt.dev.js.ast.JsArrayAccess;
-import com.google.gwt.dev.js.ast.JsArrayLiteral;
-import com.google.gwt.dev.js.ast.JsBinaryOperation;
-import com.google.gwt.dev.js.ast.JsBinaryOperator;
-import com.google.gwt.dev.js.ast.JsBlock;
-import com.google.gwt.dev.js.ast.JsBooleanLiteral;
-import com.google.gwt.dev.js.ast.JsBreak;
-import com.google.gwt.dev.js.ast.JsCase;
-import com.google.gwt.dev.js.ast.JsCatch;
-import com.google.gwt.dev.js.ast.JsConditional;
-import com.google.gwt.dev.js.ast.JsContinue;
-import com.google.gwt.dev.js.ast.JsDebugger;
-import com.google.gwt.dev.js.ast.JsDefault;
-import com.google.gwt.dev.js.ast.JsDoWhile;
-import com.google.gwt.dev.js.ast.JsEmpty;
-import com.google.gwt.dev.js.ast.JsExprStmt;
-import com.google.gwt.dev.js.ast.JsExpression;
-import com.google.gwt.dev.js.ast.JsFor;
-import com.google.gwt.dev.js.ast.JsForIn;
-import com.google.gwt.dev.js.ast.JsFunction;
-import com.google.gwt.dev.js.ast.JsIf;
-import com.google.gwt.dev.js.ast.JsInvocation;
-import com.google.gwt.dev.js.ast.JsLabel;
-import com.google.gwt.dev.js.ast.JsName;
-import com.google.gwt.dev.js.ast.JsNameOf;
-import com.google.gwt.dev.js.ast.JsNameRef;
-import com.google.gwt.dev.js.ast.JsNew;
-import com.google.gwt.dev.js.ast.JsNode;
-import com.google.gwt.dev.js.ast.JsNullLiteral;
-import com.google.gwt.dev.js.ast.JsNumberLiteral;
-import com.google.gwt.dev.js.ast.JsNumericEntry;
-import com.google.gwt.dev.js.ast.JsObjectLiteral;
-import com.google.gwt.dev.js.ast.JsParameter;
-import com.google.gwt.dev.js.ast.JsPositionMarker;
-import com.google.gwt.dev.js.ast.JsPostfixOperation;
-import com.google.gwt.dev.js.ast.JsPrefixOperation;
-import com.google.gwt.dev.js.ast.JsProgram;
-import com.google.gwt.dev.js.ast.JsProgramFragment;
-import com.google.gwt.dev.js.ast.JsPropertyInitializer;
-import com.google.gwt.dev.js.ast.JsRegExp;
-import com.google.gwt.dev.js.ast.JsReturn;
-import com.google.gwt.dev.js.ast.JsStatement;
-import com.google.gwt.dev.js.ast.JsStringLiteral;
-import com.google.gwt.dev.js.ast.JsSwitch;
-import com.google.gwt.dev.js.ast.JsSwitchMember;
-import com.google.gwt.dev.js.ast.JsThisRef;
-import com.google.gwt.dev.js.ast.JsThrow;
-import com.google.gwt.dev.js.ast.JsTry;
-import com.google.gwt.dev.js.ast.JsUnaryOperator;
-import com.google.gwt.dev.js.ast.JsVars;
-import com.google.gwt.dev.js.ast.JsVars.JsVar;
-import com.google.gwt.dev.js.ast.JsWhile;
-import com.google.gwt.dev.js.ast.NodeKind;
-import com.google.gwt.thirdparty.guava.common.base.Preconditions;
-import com.google.gwt.thirdparty.guava.common.collect.Sets;
-import com.google.gwt.thirdparty.javascript.jscomp.AbstractCompiler;
-import com.google.gwt.thirdparty.javascript.jscomp.AstValidator;
-import com.google.gwt.thirdparty.javascript.rhino.IR;
-import com.google.gwt.thirdparty.javascript.rhino.InputId;
-import com.google.gwt.thirdparty.javascript.rhino.Node;
-import com.google.gwt.thirdparty.javascript.rhino.SimpleSourceFile;
-import com.google.gwt.thirdparty.javascript.rhino.StaticSourceFile;
-import com.google.gwt.thirdparty.javascript.rhino.Token;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Translate a GWT JS AST to a Closure Compiler AST.
- */
-public class ClosureJsAstTranslator {
-  private static String getStringValue(double value) {
-    long longValue = (long) value;
-
-    // Return "1" instead of "1.0"
-    if (longValue == value) {
-      return Long.toString(longValue);
-    } else {
-      return Double.toString(value);
-    }
-  }
-
-  private final Map<String, StaticSourceFile> sourceCache = new HashMap<>();
-
-  private final boolean validate;
-  private final Set<String> globalVars = Sets.newHashSet();
-  private final Set<String> externalProperties = Sets.newHashSet();
-
-  private final Set<String> externalVars = Sets.newHashSet();
-
-  private final JsProgram program;
-  private final AbstractCompiler compiler;
-
-  ClosureJsAstTranslator(boolean validate, JsProgram program, AbstractCompiler compiler) {
-    this.program = program;
-    this.validate = validate;
-    this.compiler = compiler;
-  }
-
-  public Node translate(JsProgramFragment fragment, InputId inputId, String source) {
-    Node script = IR.script();
-    script.putBooleanProp(Node.SYNTHETIC_BLOCK_PROP, true);
-    script.setInputId(inputId);
-    script.setStaticSourceFile(getClosureSourceFile(source));
-    for (JsStatement s : fragment.getGlobalBlock().getStatements()) {
-      script.addChildToBack(transform(s));
-    }
-    // Validate the structural integrity of the AST.
-    if (validate) {
-      new AstValidator(compiler).validateScript(script);
-    }
-    return script;
-  }
-
-  Set<String> getExternalPropertyReferences() {
-    return externalProperties;
-  }
-
-  Set<String> getExternalVariableReferences() {
-    return externalVars;
-  }
-
-  Set<String> getGlobalVariableNames() {
-    return globalVars;
-  }
-
-  private Node applyOriginalName(Node n, JsNode x) {
-    /*
-     * if (x instanceof HasSymbol) { Symbol symbol = ((HasSymbol)x).getSymbol(); if (symbol != null)
-     * { String originalName = symbol.getOriginalSymbolName(); n.putProp(Node.ORIGINALNAME_PROP,
-     * originalName); } }
-     */
-    return n;
-  }
-
-  private Node applySourceInfo(Node n, HasSourceInfo srcNode) {
-    if (n != null && srcNode != null) {
-      SourceInfo info = srcNode.getSourceInfo();
-      if (info != null && info.getFileName() != null) {
-        n.setStaticSourceFile(getClosureSourceFile(info.getFileName()));
-        n.setLineno(info.getStartLine());
-        n.setCharno(0);
-      }
-    }
-    return n;
-  }
-
-  private StaticSourceFile getClosureSourceFile(String source) {
-    StaticSourceFile closureSourceFile = sourceCache.get(source);
-    if (closureSourceFile == null) {
-      closureSourceFile = new SimpleSourceFile(source, false);
-      sourceCache.put(source, closureSourceFile);
-    }
-    return closureSourceFile;
-  }
-
-  private String getName(JsName name) {
-    return name.getShortIdent();
-  }
-
-  private String getName(JsNameRef name) {
-    return name.getShortIdent();
-  }
-
-  private Node getNameNodeFor(HasName hasName) {
-    Node n = IR.name(getName(hasName.getName()));
-    applyOriginalName(n, (JsNode) hasName);
-    return applySourceInfo(n, (HasSourceInfo) hasName);
-  }
-
-  private int getTokenForOp(JsBinaryOperator op) {
-    switch (op) {
-      case MUL:
-        return Token.MUL;
-      case DIV:
-        return Token.DIV;
-      case MOD:
-        return Token.MOD;
-      case ADD:
-        return Token.ADD;
-      case SUB:
-        return Token.SUB;
-      case SHL:
-        return Token.LSH;
-      case SHR:
-        return Token.RSH;
-      case SHRU:
-        return Token.URSH;
-      case LT:
-        return Token.LT;
-      case LTE:
-        return Token.LE;
-      case GT:
-        return Token.GT;
-      case GTE:
-        return Token.GE;
-      case INSTANCEOF:
-        return Token.INSTANCEOF;
-      case INOP:
-        return Token.IN;
-      case EQ:
-        return Token.EQ;
-      case NEQ:
-        return Token.NE;
-      case REF_EQ:
-        return Token.SHEQ;
-      case REF_NEQ:
-        return Token.SHNE;
-      case BIT_AND:
-        return Token.BITAND;
-      case BIT_XOR:
-        return Token.BITXOR;
-      case BIT_OR:
-        return Token.BITOR;
-      case AND:
-        return Token.AND;
-      case OR:
-        return Token.OR;
-      case ASG:
-        return Token.ASSIGN;
-      case ASG_ADD:
-        return Token.ASSIGN_ADD;
-      case ASG_SUB:
-        return Token.ASSIGN_SUB;
-      case ASG_MUL:
-        return Token.ASSIGN_MUL;
-      case ASG_DIV:
-        return Token.ASSIGN_DIV;
-      case ASG_MOD:
-        return Token.ASSIGN_MOD;
-      case ASG_SHL:
-        return Token.ASSIGN_LSH;
-      case ASG_SHR:
-        return Token.ASSIGN_RSH;
-      case ASG_SHRU:
-        return Token.ASSIGN_URSH;
-      case ASG_BIT_AND:
-        return Token.ASSIGN_BITAND;
-      case ASG_BIT_OR:
-        return Token.ASSIGN_BITOR;
-      case ASG_BIT_XOR:
-        return Token.ASSIGN_BITXOR;
-      case COMMA:
-        return Token.COMMA;
-    }
-    return 0;
-  }
-
-  private int getTokenForOp(JsUnaryOperator op) {
-    switch (op) {
-      case BIT_NOT:
-        return Token.BITNOT;
-      case DEC:
-        return Token.DEC;
-      case DELETE:
-        return Token.DELPROP;
-      case INC:
-        return Token.INC;
-      case NEG:
-        return Token.NEG;
-      case POS:
-        return Token.POS;
-      case NOT:
-        return Token.NOT;
-      case TYPEOF:
-        return Token.TYPEOF;
-      case VOID:
-        return Token.VOID;
-    }
-    throw new IllegalStateException();
-  }
-
-  private Node transform(JsArrayAccess x) {
-    Node n = IR.getelem(transform(x.getArrayExpr()), transform(x.getIndexExpr()));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsArrayLiteral x) {
-    Node n = IR.arraylit();
-    for (Object element : x.getExpressions()) {
-      JsExpression arg = (JsExpression) element;
-      n.addChildToBack(transform(arg));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsBinaryOperation x) {
-    JsBinaryOperator op = x.getOperator();
-    Node n = new Node(getTokenForOp(op), transform(x.getArg1()), transform(x.getArg2()));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsBlock x) {
-    Node n = IR.block();
-    for (JsStatement s : x.getStatements()) {
-      n.addChildToBack(transform(s));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsBooleanLiteral x) {
-    Node n = x.getValue() ? IR.trueNode() : IR.falseNode();
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsBreak x) {
-    Node n;
-    JsNameRef label = x.getLabel();
-    if (label == null) {
-      n = IR.breakNode();
-    } else {
-      n = IR.breakNode(transformLabel(label));
-    }
-
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsCase x) {
-    Node expr = transform(x.getCaseExpr());
-    Node body = IR.block();
-    body.putBooleanProp(Node.SYNTHETIC_BLOCK_PROP, true);
-    applySourceInfo(body, x);
-
-    for (Object element : x.getStmts()) {
-      JsStatement stmt = (JsStatement) element;
-      body.addChildToBack(transform(stmt));
-    }
-
-    Node n = IR.caseNode(expr, body);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsCatch x) {
-    Node n = IR.catchNode(transformName(x.getParameter().getName()), transform(x.getBody()));
-    Preconditions.checkState(x.getCondition() == null);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsConditional x) {
-    Node n = IR.hook(transform(x.getTestExpression()), transform(x.getThenExpression()),
-        transform(x.getElseExpression()));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsContinue x) {
-    Node n;
-    JsNameRef label = x.getLabel();
-    if (label == null) {
-      n = IR.continueNode();
-    } else {
-      n = IR.continueNode(transformLabel(label));
-    }
-
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsDebugger x) {
-    Node n = new Node(Token.DEBUGGER);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsDefault x) {
-    Node body = IR.block();
-    body.putBooleanProp(Node.SYNTHETIC_BLOCK_PROP, true);
-    applySourceInfo(body, x);
-
-    for (Object element : x.getStmts()) {
-      JsStatement stmt = (JsStatement) element;
-      body.addChildToBack(transform(stmt));
-    }
-    Node n = IR.defaultCase(body);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsDoWhile x) {
-    Node n = IR.doNode(transformBody(x.getBody(), x), transform(x.getCondition()));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsEmpty x) {
-    return IR.empty();
-  }
-
-  private Node transform(JsExpression x) {
-    assert x != null;
-    switch (x.getKind()) {
-      case ARRAY:
-        return transform((JsArrayLiteral) x);
-      case ARRAY_ACCESS:
-        return transform((JsArrayAccess) x);
-      case BINARY_OP:
-        return transform((JsBinaryOperation) x);
-      case CONDITIONAL:
-        return transform((JsConditional) x);
-      case INVOKE:
-        return transform((JsInvocation) x);
-      case FUNCTION:
-        return transform((JsFunction) x);
-      case OBJECT:
-        return transform((JsObjectLiteral) x);
-      case BOOLEAN:
-        return transform((JsBooleanLiteral) x);
-      case NULL:
-        return transform((JsNullLiteral) x);
-      case NUMBER:
-        if (x instanceof JsNumericEntry) {
-          return transform((JsNumericEntry) x);
-        }
-        return transform((JsNumberLiteral) x);
-      case REGEXP:
-        return transform((JsRegExp) x);
-      case STRING:
-        return transform((JsStringLiteral) x);
-      case THIS:
-        return transform((JsThisRef) x);
-      case NAME_OF:
-        return transform((JsNameOf) x);
-      case NAME_REF:
-        return transform((JsNameRef) x);
-      case NEW:
-        return transform((JsNew) x);
-      case POSTFIX_OP:
-        return transform((JsPostfixOperation) x);
-      case PREFIX_OP:
-        return transform((JsPrefixOperation) x);
-      default:
-        throw new IllegalStateException("Unexpected expression type: "
-            + x.getClass().getSimpleName());
-    }
-  }
-
-  private Node transform(JsExprStmt x) {
-    // The GWT JS AST doesn't produce function declarations, instead
-    // they are expressions statements:
-    Node expr = transform(x.getExpression());
-    if (!expr.isFunction()) {
-      return IR.exprResult(expr);
-    } else {
-      return expr;
-    }
-  }
-
-  private Node transform(JsFor x) {
-    // The init expressions or var decl.
-    //
-    Node init;
-    if (x.getInitExpr() != null) {
-      init = transform(x.getInitExpr());
-    } else if (x.getInitVars() != null) {
-      init = transform(x.getInitVars());
-    } else {
-      init = IR.empty();
-    }
-
-    // The loop test.
-    //
-    Node cond;
-    if (x.getCondition() != null) {
-      cond = transform(x.getCondition());
-    } else {
-      cond = IR.empty();
-    }
-
-    // The incr expression.
-    //
-    Node incr;
-    if (x.getIncrExpr() != null) {
-      incr = transform(x.getIncrExpr());
-    } else {
-      incr = IR.empty();
-    }
-
-    Node body = transformBody(x.getBody(), x);
-    Node n = IR.forNode(init, cond, incr, body);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsForIn x) {
-    Node valueExpr;
-    if (x.getIterVarName() != null) {
-      valueExpr = new Node(Token.VAR, transformName(x.getIterVarName()));
-    } else {
-      // Just a name ref.
-      //
-      valueExpr = transform(x.getIterExpr());
-    }
-
-    Node n = IR.forIn(valueExpr, transform(x.getObjExpr()), transformBody(x.getBody(), x));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsFunction x) {
-    Node name;
-    if (x.getName() != null) {
-      name = getNameNodeFor(x);
-    } else {
-      name = IR.name("");
-    }
-    applySourceInfo(name, x);
-
-    Node params = IR.paramList();
-    for (Object element : x.getParameters()) {
-      JsParameter param = (JsParameter) element;
-      params.addChildToBack(transform(param));
-    }
-    applySourceInfo(params, x);
-
-    Node n = IR.function(name, params, transform(x.getBody()));
-    if (name.getString().isEmpty()) {
-      n.putProp(Node.ORIGINALNAME_PROP, "");
-    } else {
-      applyOriginalName(n, x);
-    }
-
-    /*
-     * if (x.isConstructor()) { JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
-     * builder.recordConstructor(); n.setJSDocInfo(builder.build(n)); }
-     */
-
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsIf x) {
-    Node n = IR.ifNode(transform(x.getIfExpr()), transformBody(x.getThenStmt(), x));
-    if (x.getElseStmt() != null) {
-      n.addChildToBack(transformBody(x.getElseStmt(), x));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsInvocation x) {
-    Node n = IR.call(transform(x.getQualifier()));
-    for (Object element : x.getArguments()) {
-      JsExpression arg = (JsExpression) element;
-      n.addChildToBack(transform(arg));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsLabel x) {
-    Node n = IR.label(transformLabel(x.getName()), transform(x.getStmt()));
-
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsNameOf x) {
-    Node n = transformNameAsString(x.getName().getShortIdent(), x);
-    applyOriginalName(n, x);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsNameRef x) {
-    Node n;
-    JsName name = x.getName();
-    boolean isExternal = name == null || !name.isObfuscatable();
-    if (x.getQualifier() != null) {
-      n = IR.getprop(transform(x.getQualifier()), transformNameAsString(x.getShortIdent(), x));
-      if (isExternal) {
-        this.externalProperties.add(x.getShortIdent());
-      }
-    } else {
-      n = transformName(x.getShortIdent(), x);
-      if (isExternal) {
-        this.externalVars.add(x.getShortIdent());
-      } else if (name.getEnclosing() == program.getScope()) {
-        this.globalVars.add(x.getShortIdent());
-      }
-    }
-    applyOriginalName(n, x);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsNew x) {
-    Node n = IR.newNode(transform(x.getConstructorExpression()));
-    for (Object element : x.getArguments()) {
-      JsExpression arg = (JsExpression) element;
-      n.addChildToBack(transform(arg));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsNullLiteral x) {
-    return IR.nullNode();
-  }
-
-  private Node transform(JsNumericEntry x) {
-    return IR.number(x.getValue());
-  }
-
-  private Node transform(JsNumberLiteral x) {
-    return IR.number(x.getValue());
-  }
-
-  private Node transform(JsObjectLiteral x) {
-    Node n = IR.objectlit();
-
-    for (JsPropertyInitializer element : x.getPropertyInitializers()) {
-      Node key;
-      if (element.getLabelExpr().getKind() == NodeKind.NUMBER) {
-        key = transformNumberAsString((JsNumberLiteral) element.getLabelExpr());
-        key.putBooleanProp(Node.QUOTED_PROP, true);
-      } else if (element.getLabelExpr().getKind() == NodeKind.NAME_REF) {
-        key = transformNameAsString(((JsNameRef) element.getLabelExpr()).getShortIdent(),
-            element.getLabelExpr());
-      } else {
-        key = transform(element.getLabelExpr());
-      }
-      Preconditions.checkState(key.isString(), key);
-      key.setType(Token.STRING_KEY);
-      // Set as quoted as the rhino version we use does not distinguish one from the other.
-      // Closure assumes unquoted property names are obfuscatable, but since there is no way to
-      // distinguish between them at this point they have to be assumed quoted, hence not
-      // obfuscatable.
-      // TODO(rluble): Make sure this is handled correctly once rhino is upgraded.
-      key.putBooleanProp(Node.QUOTED_PROP, true);
-      n.addChildToBack(IR.propdef(key, transform(element.getValueExpr())));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsParameter x) {
-    return getNameNodeFor(x);
-  }
-
-  private Node transform(JsPositionMarker x) {
-    return IR.empty();
-  }
-
-  private Node transform(JsPostfixOperation x) {
-    Node n = new Node(getTokenForOp(x.getOperator()), transform(x.getArg()));
-    n.putBooleanProp(Node.INCRDECR_PROP, true);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsPrefixOperation x) {
-    Node n = new Node(getTokenForOp(x.getOperator()), transform(x.getArg()));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsRegExp x) {
-    String flags = x.getFlags();
-    Node n = IR.regexp(Node.newString(x.getPattern()),
-        Node.newString(flags != null ? x.getFlags() : ""));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsReturn x) {
-    Node n = IR.returnNode();
-    JsExpression result = x.getExpr();
-    if (result != null) {
-      n.addChildToBack(transform(x.getExpr()));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsStatement x) {
-    switch (x.getKind()) {
-      case BLOCK:
-        return transform((JsBlock) x);
-      case BREAK:
-        return transform((JsBreak) x);
-      case CONTINUE:
-        return transform((JsContinue) x);
-      case DEBUGGER:
-        return transform((JsDebugger) x);
-      case DO:
-        return transform((JsDoWhile) x);
-      case EMPTY:
-        return transform((JsEmpty) x);
-      case EXPR_STMT:
-        return transform((JsExprStmt) x);
-      case FOR:
-        return transform((JsFor) x);
-      case FOR_IN:
-        return transform((JsForIn) x);
-      case IF:
-        return transform((JsIf) x);
-      case LABEL:
-        return transform((JsLabel) x);
-      case POSITION_MARKER:
-        return transform((JsPositionMarker) x);
-      case RETURN:
-        return transform((JsReturn) x);
-      case SWITCH:
-        return transform((JsSwitch) x);
-      case THROW:
-        return transform((JsThrow) x);
-      case TRY:
-        return transform((JsTry) x);
-      case VARS:
-        return transform((JsVars) x);
-      case WHILE:
-        return transform((JsWhile) x);
-      default:
-        throw new IllegalStateException("Unexpected statement type: "
-            + x.getClass().getSimpleName());
-    }
-  }
-
-  private Node transform(JsStringLiteral x) {
-    return IR.string(x.getValue());
-  }
-
-  private Node transform(JsSwitch x) {
-    Node n = IR.switchNode(transform(x.getExpr()));
-    for (JsSwitchMember member : x.getCases()) {
-      n.addChildToBack(transform(member));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsSwitchMember x) {
-    switch (x.getKind()) {
-      case CASE:
-        return transform((JsCase) x);
-      case DEFAULT:
-        return transform((JsDefault) x);
-      default:
-        throw new IllegalStateException("Unexpected switch member type: "
-            + x.getClass().getSimpleName());
-    }
-  }
-
-  private Node transform(JsThisRef x) {
-    Node n = new Node(Token.THIS);
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsThrow x) {
-    Node n = IR.throwNode(transform(x.getExpr()));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsTry x) {
-    Node n = new Node(Token.TRY, transform(x.getTryBlock()));
-
-    Node catches = new Node(Token.BLOCK);
-    for (JsCatch catchBlock : x.getCatches()) {
-      catches.addChildToBack(transform(catchBlock));
-    }
-    n.addChildToBack(catches);
-
-    JsBlock finallyBlock = x.getFinallyBlock();
-    if (finallyBlock != null) {
-      n.addChildToBack(transform(finallyBlock));
-    }
-
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsVar x) {
-    Node n = getNameNodeFor(x);
-    JsExpression initExpr = x.getInitExpr();
-    if (initExpr != null) {
-      n.addChildToBack(transform(initExpr));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsVars x) {
-    Node n = new Node(Token.VAR);
-    for (JsVar var : x) {
-      n.addChildToBack(transform(var));
-    }
-    return applySourceInfo(n, x);
-  }
-
-  private Node transform(JsWhile x) {
-    Node n =
-        IR.forNode(IR.empty(), transform(x.getCondition()), IR.empty(), transformBody(x.getBody(),
-            x));
-    return applySourceInfo(n, x);
-  }
-
-  private Node transformBody(JsStatement x, HasSourceInfo parent) {
-    Node n = transform(x);
-    if (!n.isBlock()) {
-      Node stmt = n;
-      n = IR.block();
-      if (!stmt.isEmpty()) {
-        n.addChildToBack(stmt);
-      }
-      applySourceInfo(n, parent);
-    }
-    return n;
-  }
-
-  private Node transformLabel(JsName label) {
-    Node n = IR.labelName(getName(label));
-    return applySourceInfo(n, label.getStaticRef());
-  }
-
-  private Node transformLabel(JsNameRef label) {
-    Node n = IR.labelName(getName(label));
-    return applySourceInfo(n, label);
-  }
-
-  private Node transformName(JsName name) {
-    Node n = IR.name(getName(name));
-    return applySourceInfo(n, name.getStaticRef());
-  }
-
-  private Node transformName(String name, HasSourceInfo info) {
-    Node n = IR.name(name);
-    return applySourceInfo(n, info);
-  }
-
-  private Node transformNameAsString(String name, HasSourceInfo info) {
-    Node n = IR.string(name);
-    return applySourceInfo(n, info);
-  }
-
-  private Node transformNumberAsString(JsNumberLiteral literalNode) {
-    Node irNode = Node.newString(getStringValue(literalNode.getValue()));
-    return irNode;
-  }
-}
diff --git a/dev/core/src/com/google/gwt/dev/js/ClosureJsRunner.java b/dev/core/src/com/google/gwt/dev/js/ClosureJsRunner.java
deleted file mode 100644
index f50ac99..0000000
--- a/dev/core/src/com/google/gwt/dev/js/ClosureJsRunner.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.dev.js;
-
-import com.google.gwt.dev.jjs.JsOutputOption;
-import com.google.gwt.dev.jjs.ast.JProgram;
-import com.google.gwt.dev.jjs.impl.codesplitter.FragmentPartitioningResult;
-import com.google.gwt.dev.js.ast.JsProgram;
-import com.google.gwt.dev.js.ast.JsProgramFragment;
-import com.google.gwt.thirdparty.guava.common.base.Preconditions;
-import com.google.gwt.thirdparty.guava.common.base.Throwables;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
-import com.google.gwt.thirdparty.guava.common.collect.Lists;
-import com.google.gwt.thirdparty.guava.common.collect.Maps;
-import com.google.gwt.thirdparty.guava.common.collect.Sets;
-import com.google.gwt.thirdparty.guava.common.io.ByteStreams;
-import com.google.gwt.thirdparty.javascript.jscomp.CheckLevel;
-import com.google.gwt.thirdparty.javascript.jscomp.Compiler;
-import com.google.gwt.thirdparty.javascript.jscomp.CompilerInput;
-import com.google.gwt.thirdparty.javascript.jscomp.CompilerOptions;
-import com.google.gwt.thirdparty.javascript.jscomp.CompilerOptions.Reach;
-import com.google.gwt.thirdparty.javascript.jscomp.DiagnosticGroups;
-import com.google.gwt.thirdparty.javascript.jscomp.JSError;
-import com.google.gwt.thirdparty.javascript.jscomp.JSModule;
-import com.google.gwt.thirdparty.javascript.jscomp.PropertyRenamingPolicy;
-import com.google.gwt.thirdparty.javascript.jscomp.Result;
-import com.google.gwt.thirdparty.javascript.jscomp.SourceAst;
-import com.google.gwt.thirdparty.javascript.jscomp.SourceFile;
-import com.google.gwt.thirdparty.javascript.jscomp.VariableMap;
-import com.google.gwt.thirdparty.javascript.jscomp.VariableRenamingPolicy;
-import com.google.gwt.thirdparty.javascript.jscomp.WarningLevel;
-import com.google.gwt.thirdparty.javascript.rhino.InputId;
-import com.google.gwt.thirdparty.javascript.rhino.Node;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- * A class that represents an single invocation of the Closure Compiler.
- */
-public class ClosureJsRunner {
-  // The externs expected in externs.zip, in sorted order.
-  private static final List<String> DEFAULT_EXTERNS_NAMES = ImmutableList.of(
-      // JS externs
-      "es3.js",
-      "es5.js",
-      "es6.js",
-      "es6_collections.js",
-
-      // Event APIs
-      "browser/gecko_event.js",
-      "browser/ie_event.js",
-      "browser/w3c_device_sensor_event.js",
-      "browser/w3c_event.js",
-      "browser/w3c_event3.js",
-      "browser/w3c_touch_event.js",
-      "browser/webkit_event.js",
-
-      // DOM apis
-      "browser/gecko_dom.js",
-      "browser/ie_dom.js",
-      "browser/w3c_dom1.js",
-      "browser/w3c_dom2.js",
-      "browser/w3c_dom3.js",
-      "browser/webkit_dom.js",
-
-      // CSS apis
-      "browser/gecko_css.js",
-      "browser/ie_css.js",
-      "browser/w3c_css.js",
-      "browser/webkit_css.js",
-
-      // Top-level namespaces
-      "browser/chrome.js",
-      "browser/google.js",
-
-      // Miscellaneous
-      "browser/deprecated.js",
-      "browser/fetchapi.js",
-      "browser/fileapi.js",
-      "browser/flash.js",
-      "browser/gecko_xml.js",
-      "browser/html5.js",
-      "browser/ie_vml.js",
-      "browser/intl.js",
-      "browser/iphone.js",
-      "browser/mediasource.js",
-      "browser/page_visibility.js",
-      "browser/streamsapi.js",
-      "browser/url.js",
-      "browser/v8.js",
-      "browser/w3c_anim_timing.js",
-      "browser/w3c_audio.js",
-      "browser/w3c_batterystatus.js",
-      "browser/w3c_css3d.js",
-      "browser/w3c_elementtraversal.js",
-      "browser/w3c_geolocation.js",
-      "browser/w3c_indexeddb.js",
-      "browser/w3c_navigation_timing.js",
-      "browser/w3c_range.js",
-      "browser/w3c_rtc.js",
-      "browser/w3c_selectors.js",
-      "browser/w3c_serviceworker.js",
-      "browser/w3c_webcrypto.js",
-      "browser/w3c_xml.js",
-      "browser/webgl.js",
-      "browser/webkit_notifications.js",
-      "browser/webstorage.js",
-      "browser/whatwg_encoding.js",
-      "browser/window.js");
-
-  /**
-   * @return a mutable list
-   * @throws IOException
-   */
-  public static List<SourceFile> getDefaultExterns() throws IOException {
-    Class<ClosureJsRunner> clazz = ClosureJsRunner.class;
-    InputStream input = clazz.getResourceAsStream("/com/google/javascript/jscomp/externs.zip");
-    if (input == null) {
-      /*
-       * HACK - the open source version of the closure compiler maps the resource into a different
-       * location.
-       */
-      input = clazz.getResourceAsStream("/externs.zip");
-    }
-    ZipInputStream zip = new ZipInputStream(input);
-    Map<String, SourceFile> externsMap = Maps.newHashMap();
-    for (ZipEntry entry = null; (entry = zip.getNextEntry()) != null;) {
-      if (!entry.isDirectory()) {
-        BufferedInputStream entryStream =
-            new BufferedInputStream(ByteStreams.limit(zip, entry.getSize()));
-        externsMap.put(entry.getName(), SourceFile.fromInputStream(
-            // Give the files an odd prefix, so that they do not conflict
-            // with the user's files.
-            "externs.zip//" + entry.getName(), entryStream, Charset.defaultCharset()));
-      }
-    }
-
-    Preconditions.checkState(externsMap.keySet().equals(Sets.newHashSet(DEFAULT_EXTERNS_NAMES)),
-        "Externs zip must match our hard-coded list of externs.");
-
-    // Order matters, so the resources must be added to the result list
-    // in the expected order.
-    List<SourceFile> externs = Lists.newArrayList();
-    for (String key : DEFAULT_EXTERNS_NAMES) {
-      externs.add(externsMap.get(key));
-    }
-
-    return externs;
-  }
-
-  /**
-   * The instance of the Closure Compiler used for the compile.
-   */
-  private Compiler compiler = null;
-
-  /**
-   * The set of external properties discovered in the provided AST.
-   */
-  private Set<String> externalProps = Sets.newHashSet();
-
-  /**
-   * The set of external global variables discovered in the provided AST.
-   */
-  private Set<String> externalVars = Sets.newHashSet();
-
-  /**
-   * The set of internal global variables discovered in the provided AST.
-   */
-  private Set<String> globalVars = Sets.newHashSet();
-
-  /**
-   * Whether AST validation should be performed on the generated
-   * Closure Compiler AST.
-   */
-  private final boolean validate = true;
-
-  /**
-   * A map of GWT fragment numbers to Closure module indexes.
-   */
-  private int[] closureModuleSequenceMap;
-
-  /**
-   * The number of non-exclusive fragments that are part of the load sequence
-   * (including the main and leftovers).
-   */
-  private int loadModulesCount;
-
-  public ClosureJsRunner() {
-  }
-
-  public void compile(JProgram jprogram, JsProgram program, String[] js,
-      JsOutputOption jsOutputOption) {
-    CompilerOptions options;
-    options = getClosureCompilerOptions(jsOutputOption);
-
-    // Turn off Closure Compiler logging
-    Logger.getLogger("com.google.gwt.thirdparty.javascript.jscomp").setLevel(Level.OFF);
-
-    // Create a fresh compiler instance.
-    compiler = new Compiler();
-
-    // Translate the ASTs and build the modules
-    computeFragmentMap(jprogram, program);
-    List<JSModule> modules = createClosureModules(program);
-
-    // Build the externs based on what we discovered building the modules.
-    List<SourceFile> externs = getClosureCompilerExterns();
-
-    Result result = compiler.compileModules(externs, modules, options);
-    if (result.success) {
-      int fragments = program.getFragmentCount();
-      for (int i = 0; i < fragments; i++) {
-        int module = mapFragmentIndexToModuleIndex(i);
-        js[i] = compiler.toSource(modules.get(module));
-      }
-    } else {
-      for (JSError error : result.errors) {
-        System.err.println("error optimizing:" + error.toString());
-        throw new RuntimeException(error.description);
-      }
-    }
-  }
-
-  protected List<SourceFile> getDefaultExternsList() {
-    List<SourceFile> defaultExterns;
-    try {
-      defaultExterns = getDefaultExterns();
-      return defaultExterns;
-    } catch (IOException e) {
-      throw Throwables.propagate(e);
-    }
-  }
-
-  private void computeFragmentMap(JProgram jprogram, JsProgram jsProgram) {
-    int fragments = jsProgram.getFragmentCount();
-    List<Integer> initSeq = jprogram.getInitialFragmentIdSequence();
-    FragmentPartitioningResult partitionResult = jprogram.getFragmentPartitioningResult();
-
-    //
-    // The fragments are expected in a specific order:
-    // init, split-1, split-2, ...,
-    // where the leftovers are dependent on the init module
-    // and the split modules are dependent on the leftovers
-    //
-    // However, Closure Compiler modules must be in dependency order
-    //
-
-    assert closureModuleSequenceMap == null;
-    closureModuleSequenceMap = new int[fragments];
-    for (int i = 0; i < fragments; i++) {
-      closureModuleSequenceMap[i] = -1;
-    }
-
-    int module = 0;
-    // The initial fragments is always first.
-    closureModuleSequenceMap[0] = module++;
-
-    // Then come the specified load order sequence
-    for (int i = 0; i < initSeq.size(); i++) {
-      int initSeqNum = initSeq.get(i);
-      if (partitionResult != null) {
-        initSeqNum = partitionResult.getFragmentForRunAsync(initSeqNum);
-      }
-      closureModuleSequenceMap[initSeqNum] = module++;
-    }
-
-    // Then the leftovers fragments:
-    if (fragments > 1) {
-      int leftoverIndex = fragments - 1;
-      if (partitionResult != null) {
-        leftoverIndex = partitionResult.getLeftoverFragmentId();
-      }
-      closureModuleSequenceMap[leftoverIndex] = module++;
-    }
-
-    // Finally, the exclusive fragments.
-    // The order of the remaining fragments doesn't matter.
-    for (int i = 0; i < fragments; i++) {
-      if (closureModuleSequenceMap[i] == -1) {
-        closureModuleSequenceMap[i] = module++;
-      }
-    }
-    loadModulesCount = 1 + initSeq.size() + 1; // main + init sequence + leftovers
-  }
-
-  private CompilerInput createClosureJsAst(JsProgram program, JsProgramFragment fragment,
-      String source) {
-    String inputName = source;
-    InputId inputId = new InputId(inputName);
-    ClosureJsAstTranslator translator = new ClosureJsAstTranslator(validate, program, compiler);
-    Node root = translator.translate(fragment, inputId, source);
-    globalVars.addAll(translator.getGlobalVariableNames());
-    externalProps.addAll(translator.getExternalPropertyReferences());
-    externalVars.addAll(translator.getExternalVariableReferences());
-    SourceAst sourceAst = new ClosureJsAst(inputId, root);
-    CompilerInput input = new CompilerInput(sourceAst, false);
-    return input;
-  }
-
-  private JSModule createClosureModule(JsProgram program, JsProgramFragment fragment, String source) {
-    JSModule module = new JSModule(source);
-    module.add(createClosureJsAst(program, fragment, source));
-    return module;
-  }
-
-  private List<JSModule> createClosureModules(JsProgram program) {
-    int fragments = program.getFragmentCount();
-    JSModule[] modules = new JSModule[fragments];
-
-    for (int i = 0; i < fragments; i++) {
-      modules[mapFragmentIndexToModuleIndex(i)] =
-          createClosureModule(program, program.getFragment(i), "module" + i);
-    }
-    if (fragments > 1) {
-      //
-      // The fragments are expected in a specific order:
-      // init, split-1, split-2, ...,
-      // where the leftovers are dependent on the init module
-      // and the split modules are dependent on the leftovers
-      for (int i = 1; i < loadModulesCount; i++) {
-        modules[i].addDependency(modules[i - 1]);
-      }
-
-      JSModule leftovers = modules[loadModulesCount - 1];
-      for (int i = loadModulesCount; i < modules.length; i++) {
-        Preconditions.checkNotNull(modules[i], "Module: ", i);
-        modules[i].addDependency(leftovers);
-      }
-    }
-    modules[0].add(SourceFile.fromCode("hack", "window['gwtOnLoad'] = gwtOnLoad;\n"));
-
-    return Arrays.asList(modules);
-  }
-
-  private List<SourceFile> getClosureCompilerExterns() {
-    List<SourceFile> externs = getDefaultExternsList();
-    externs.add(SourceFile.fromCode("gwt_externs",
-
-    "var gwtOnLoad;\n"
-        + "var $entry;\n"
-        + "    var $gwt_version;\n"
-        + "    var $wnd;\n"
-        + "    var $doc;\n"
-        + "    var $moduleName\n"
-        + "    var $moduleBase;\n"
-        + "    var $gwt\n"
-        + "    var $strongName;\n"
-        + "    var $stats;\n"
-        + "    var $sessionId;\n"
-        + "    window.prototype.__gwtStatsEvent;\n"
-        + "    window.prototype.__gwtStatsSessionId;\n"
-        + "    window.prototype.moduleName;\n"
-        + "    window.prototype.sessionId;\n"
-        + "    window.prototype.subSystem;\n"
-        + "    window.prototype.evtGroup;\n"
-        + "    window.prototype.millis;\n"
-        + "    window.prototype.type;\n"
-        + "    window.prototype.$h;\n"
-        + "\n"));
-
-    // Generate externs
-    String generatedExterns = "var gwt_externs;\n";
-    for (String prop : this.externalProps) {
-      generatedExterns += "gwt_externs." + prop + ";\n";
-    }
-
-    for (String var : this.externalVars) {
-      generatedExterns += "var " + var + ";\n";
-    }
-
-    externs.add(SourceFile.fromCode("gwt_generated_externs", generatedExterns));
-
-    return externs;
-  }
-
-  private CompilerOptions getClosureCompilerOptions(JsOutputOption jsOutputOption) {
-    CompilerOptions options = new CompilerOptions();
-    WarningLevel.QUIET.setOptionsForWarningLevel(options);
-
-    // Basically, use CompilationLevel.ADVANCED_OPTIMIZATIONS:
-
-    // Build an identity map of variable names to prevent GWT names from
-    // being renamed while allowing new global variables to be renamed.
-    HashMap<String, String> varNames = new HashMap<>();
-    for (String var : globalVars) {
-      varNames.put(var, var);
-    }
-    options.setInputVariableMap(VariableMap.fromMap(varNames));
-    if (jsOutputOption == JsOutputOption.OBFUSCATED) {
-      options.setRenamingPolicy(VariableRenamingPolicy.ALL, PropertyRenamingPolicy.OFF);
-      options.setPrettyPrint(false);
-      // This can help debug renaming policy changes.
-      // options.generatePseudoNames = true;
-    } else {
-      options.setRenamingPolicy(VariableRenamingPolicy.OFF, PropertyRenamingPolicy.OFF);
-      options.setPrettyPrint(true);
-    }
-
-    // All the safe optimizations.
-    options.setClosurePass(true);
-    options.setFoldConstants(true);
-    options.setCoalesceVariableNames(true);
-    options.setDeadAssignmentElimination(true);
-    options.setExtractPrototypeMemberDeclarations(true);
-    options.setCollapseVariableDeclarations(true);
-    options.setConvertToDottedProperties(true);
-    options.setRewriteFunctionExpressions(true);
-    options.setLabelRenaming(true);
-    options.setRemoveDeadCode(true);
-    options.setOptimizeArgumentsArray(true);
-    options.setCollapseObjectLiterals(true);
-    options.setShadowVariables(true);
-
-    // All the advance optimizations.
-    options.setReserveRawExports(true);
-    options.setRemoveUnusedPrototypeProperties(true);
-    options.setCollapseAnonymousFunctions(true);
-    options.setSmartNameRemoval(true); // ?
-    options.setInlineConstantVars(true);
-    options.setInlineFunctions(Reach.ALL);
-    options.setInlineGetters(true);
-    options.setInlineVariables(Reach.ALL);
-    options.setFlowSensitiveInlineVariables(true);
-    options.setComputeFunctionSideEffects(true);
-    // Remove unused vars also removes unused functions.
-    options.setRemoveUnusedVariables(Reach.ALL);
-    options.setOptimizeParameters(true);
-    options.setOptimizeReturns(true);
-    options.setOptimizeCalls(true);
-
-    // Maybe turn these off as well
-    options.setCollapseProperties(true); // ?
-    options.setCrossModuleCodeMotion(true); // ?
-    options.setCrossModuleMethodMotion(true); // ?
-    options.setDevirtualizePrototypeMethods(true); // ?
-
-    // Advanced optimization, disabled
-    options.setRemoveClosureAsserts(false);
-    options.setRemoveUnusedPrototypePropertiesInExterns(false);
-    options.setCheckGlobalThisLevel(CheckLevel.OFF);
-    options.setRewriteFunctionExpressions(false); // Performance hit
-
-    // Kindly tell the user that they have JsDocs that we don't understand.
-    options.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.OFF);
-
-    return options;
-  }
-
-  private int mapFragmentIndexToModuleIndex(int index) {
-    assert closureModuleSequenceMap.length > index;
-    return closureModuleSequenceMap[index];
-  }
-}
diff --git a/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java b/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java
index 7cb510a..f936585 100644
--- a/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java
+++ b/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java
@@ -328,7 +328,6 @@
       "java", "Packages", "netscape", "sun", "JavaObject", "JavaClass", "JavaArray", "JavaMember",
 
       // GWT-defined identifiers
-      // If adding a new variable, don't forget to update ClosureJsRunner#getClosureCompilerExterns.
       "$wnd", "$doc", "$moduleName", "$moduleBase", "$gwt_version", "$sessionId", "gwtOnLoad",
       // Any new gwt-related global should be a property of $gwt.
       "$gwt",
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableClosureCompiler.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableClosureCompiler.java
deleted file mode 100644
index 3c8ab42..0000000
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableClosureCompiler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.dev.util.arg;
-
-import com.google.gwt.util.tools.ArgHandlerFlag;
-
-/**
- * Compiles output Javascript with the Closure compiler for even further optimizations.
- */
-public class ArgHandlerEnableClosureCompiler extends ArgHandlerFlag {
-
-  private final OptionEnableClosureCompiler option;
-
-  public ArgHandlerEnableClosureCompiler(OptionEnableClosureCompiler option) {
-    this.option = option;
-
-    addTagValue("-XenableClosureCompiler", true);
-  }
-
-  @Override
-  public String getPurposeSnippet() {
-    return "Compile output Javascript with the Closure compiler for even further optimizations.";
-  }
-
-  @Override
-  public String getLabel() {
-    return "closureCompiler";
-  }
-
-  @Override
-  public boolean setFlag(boolean value) {
-    option.setClosureCompilerEnabled(value);
-    return true;
-  }
-
-  @Override
-  public boolean isExperimental() {
-    return true;
-  }
-
-  @Override
-  public boolean getDefaultValue() {
-    return option.isClosureCompilerEnabled();
-  }
-}
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/OptionEnableClosureCompiler.java b/dev/core/src/com/google/gwt/dev/util/arg/OptionEnableClosureCompiler.java
deleted file mode 100644
index 77649db..0000000
--- a/dev/core/src/com/google/gwt/dev/util/arg/OptionEnableClosureCompiler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.dev.util.arg;
-
-/**
- * Encapsulates a compiler option to enable Closure Compiler optimizations.
- */
-public interface OptionEnableClosureCompiler {
-  boolean isClosureCompilerEnabled();
-
-  void setClosureCompilerEnabled(boolean enabled);
-}
diff --git a/dev/core/test/com/google/gwt/dev/PrecompileTaskArgProcessorTest.java b/dev/core/test/com/google/gwt/dev/PrecompileTaskArgProcessorTest.java
index cb4630e..77c5bb3 100644
--- a/dev/core/test/com/google/gwt/dev/PrecompileTaskArgProcessorTest.java
+++ b/dev/core/test/com/google/gwt/dev/PrecompileTaskArgProcessorTest.java
@@ -41,7 +41,7 @@
         "-XdisableClassMetadata", "-XdisableClusterSimilarFunctions",
         "-XdisableInlineLiteralParameters", "-XdisableOptimizeDataflow", "-XdisableOrdinalizeEnums",
         "-XdisableRemoveDuplicateFunctions", "-XdisableRunAsync", "-XdisableSoycHtml",
-        "-XdisableUpdateCheck", "-ea", "-XenableClosureCompiler", "-soyc", "-XsoycDetailed",
+        "-XdisableUpdateCheck", "-ea", "-soyc", "-XsoycDetailed",
         "-XenableJsonSoyc", "-strict", "com.google.gwt.dev.DevModule");
 
     // Show that the flags were recognized and ended up modifying options.
@@ -62,8 +62,6 @@
     assertNotEquals(defaultOptions.isSoycHtmlDisabled(), handledOptions.isSoycHtmlDisabled());
     assertNotEquals(defaultOptions.isUpdateCheckDisabled(), handledOptions.isUpdateCheckDisabled());
     assertNotEquals(defaultOptions.isEnableAssertions(), handledOptions.isEnableAssertions());
-    assertNotEquals(
-        defaultOptions.isClosureCompilerEnabled(), handledOptions.isClosureCompilerEnabled());
     assertNotEquals(defaultOptions.isSoycEnabled(), handledOptions.isSoycEnabled());
     assertNotEquals(defaultOptions.isSoycExtra(), handledOptions.isSoycExtra());
     assertNotEquals(defaultOptions.isJsonSoycEnabled(), handledOptions.isJsonSoycEnabled());
diff --git a/eclipse/dev/.classpath b/eclipse/dev/.classpath
index 14118db..261aa18 100644
--- a/eclipse/dev/.classpath
+++ b/eclipse/dev/.classpath
@@ -24,7 +24,6 @@
 	<classpathentry kind="var" path="GWT_TOOLS/lib/guava/guava-19.0/guava-19.0-rebased.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/gson/gson-2.6.2.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/jscomp/20160315/sourcemap-rebased.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/jscomp/20160315/compiler-rebased.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/json/android-sdk-19.1/json-android-rebased.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-collections-3.2.2.jar"/>
 	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/tomcat/tomcat-servlet-api-8.0.28.jar"/>
diff --git a/eclipse/dev/codeserver/.classpath b/eclipse/dev/codeserver/.classpath
index 452e943..88a6968 100644
--- a/eclipse/dev/codeserver/.classpath
+++ b/eclipse/dev/codeserver/.classpath
@@ -6,7 +6,6 @@
 	<classpathentry kind="var" path="GWT_TOOLS/lib/guava/guava-19.0/guava-19.0-rebased.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/gson-2.6.2.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/jscomp/20160315/sourcemap-rebased.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/jscomp/20160315/compiler-rebased.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/junit/junit-4.8.2.jar" sourcepath="/GWT_TOOLS/lib/junit/junit-4.8.2-src.zip"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/gwt-dev"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/gwt-user"/>
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index 3cbbc4b..f8224ef 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -51,7 +51,6 @@
 import com.google.gwt.dev.util.arg.ArgHandlerDisableUpdateCheck;
 import com.google.gwt.dev.util.arg.ArgHandlerDraftCompile;
 import com.google.gwt.dev.util.arg.ArgHandlerEnableAssertions;
-import com.google.gwt.dev.util.arg.ArgHandlerEnableClosureCompiler;
 import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
 import com.google.gwt.dev.util.arg.ArgHandlerGenDir;
 import com.google.gwt.dev.util.arg.ArgHandlerGenerateJsInteropExports;
@@ -284,7 +283,6 @@
       registerHandler(new ArgHandlerDisableRunAsync(options));
       registerHandler(new ArgHandlerDisableUpdateCheck(options));
       registerHandler(new ArgHandlerDraftCompile(options));
-      registerHandler(new ArgHandlerEnableClosureCompiler(options));
       registerHandler(new ArgHandlerLocalWorkers(options));
       registerHandler(new ArgHandlerNamespace(options));
       registerHandler(new ArgHandlerOptimize(options));