Repository: google/closure-compiler
Pull request #1081 (2015-08-14 23:12:34)

ES6: Remove redundant namespace declaration
When converting ECMAScript 6 modules, it is not necessary to add an extra namespace declaration. The namespace will be declared through `goog.provide`. When processing the `goog.provide`, the compiler will then add a JSDoc `@const` tag to the namespace. (https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java#L1423).

For example, instead of converting the following ES6 module:

```javascript
// calculator.js
export function square(x) {
        return x * x;
}
```

to:

```javascript
goog.provide("module$calculator");
function square$$module$calculator(x) {
  return x * x;
}
var module$calculator = {};
module$calculator.square = square$$module$calculator;
```

it will now be converted to:

```javascript
goog.provide("module$calculator");
function square$$module$calculator(x) {
  return x * x;
}
module$calculator.square = square$$module$calculator;
```

which will later be converted to:

```javascript
var /** @const */ module$calculator = {};
function square$$module$calculator(x) {
  return x * x;
}
module$calculator.square = square$$module$calculator;
```


Patch:
diff --git a/externs/es6.js b/externs/es6.js
index a59bc0520..38f61fa3e 100644
--- a/externs/es6.js
+++ b/externs/es6.js
@@ -919,18 +919,9 @@ function Promise(resolver) {}
 
 
 /**
- * @param {VALUE=} opt_value
- * @return {RESULT}
- * @template VALUE
- * @template RESULT := type('Promise',
- *     cond(isUnknown(VALUE), unknown(),
- *       mapunion(VALUE, (V) =>
- *         cond(isTemplatized(V) && sub(rawTypeOf(V), 'IThenable'),
- *           templateTypeOf(V, 0),
- *           cond(sub(V, 'Thenable'),
- *              unknown(),
- *              V)))))
- * =:
+ * @param {(TYPE|IThenable<TYPE>)=} opt_value
+ * @return {!Promise<TYPE>}
+ * @template TYPE
  */
 Promise.resolve = function(opt_value) {};
 
@@ -1082,13 +1073,3 @@ Number.isInteger = function(value) {};
  * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger
  */
 Number.isSafeInteger = function(value) {};
-
-
-
-/**
- * @param {!Object} target
- * @param {...Object} var_args
- * @return {!Object}
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
- */
-Object.assign = function(target, var_args) {};
diff --git a/src/com/google/javascript/jscomp/AngularPass.java b/src/com/google/javascript/jscomp/AngularPass.java
index e3fd62182..d818a5187 100644
--- a/src/com/google/javascript/jscomp/AngularPass.java
+++ b/src/com/google/javascript/jscomp/AngularPass.java
@@ -92,15 +92,6 @@ class AngularPass extends AbstractPostOrderCallback
           "@ngInject can only be used when defining a function or " +
           "assigning a function expression.");
 
-  static final DiagnosticType INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM =
-      DiagnosticType.error("JSC_INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM",
-          "@ngInject cannot be used on functions containing "
-          + "destructured parameter.");
-
-  static final DiagnosticType INJECTED_FUNCTION_HAS_DEFAULT_VALUE =
-      DiagnosticType.error("JSC_INJECTED_FUNCTION_HAS_DEFAULT_VALUE",
-          "@ngInject cannot be used on functions containing default value.");
-
   @Override
   public void process(Node externs, Node root) {
     hotSwapScript(root, null);
@@ -116,7 +107,7 @@ class AngularPass extends AbstractPostOrderCallback
       String name = entry.getName();
       Node fn = entry.getFunctionNode();
       List<Node> dependencies = createDependenciesList(fn);
-      // skips entry if it does not have any dependencies.
+      // skips entry if it does have any dependencies.
       if (dependencies.isEmpty()) {
         continue;
       }
@@ -159,7 +150,7 @@ class AngularPass extends AbstractPostOrderCallback
    * @param n the FUNCTION node.
    * @return STRING nodes.
    */
-  private List<Node> createDependenciesList(Node n) {
+  private static List<Node> createDependenciesList(Node n) {
     Preconditions.checkArgument(n.isFunction());
     Node params = NodeUtil.getFunctionParameters(n);
     if (params != null) {
@@ -173,21 +164,11 @@ class AngularPass extends AbstractPostOrderCallback
    * @param params PARAM_LIST node.
    * @return array of STRING nodes.
    */
-  private List<Node> createStringsFromParamList(Node params) {
+  private static List<Node> createStringsFromParamList(Node params) {
     Node param = params.getFirstChild();
     ArrayList<Node> names = new ArrayList<>();
-    while (param != null) {
-      if (param.isName()) {
-        names.add(IR.string(param.getString()).srcref(param));
-      } else if (param.isDestructuringPattern()) {
-        compiler.report(JSError.make(param,
-            INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM));
-        return new ArrayList<>();
-      } else if (param.isDefaultValue()) {
-        compiler.report(JSError.make(param,
-            INJECTED_FUNCTION_HAS_DEFAULT_VALUE));
-        return new ArrayList<>();
-      }
+    while (param != null && param.isName()) {
+      names.add(IR.string(param.getString()).srcref(param));
       param = param.getNext();
     }
     return names;
diff --git a/src/com/google/javascript/jscomp/CheckJSDoc.java b/src/com/google/javascript/jscomp/CheckJSDoc.java
index b33defcaf..51b05927f 100644
--- a/src/com/google/javascript/jscomp/CheckJSDoc.java
+++ b/src/com/google/javascript/jscomp/CheckJSDoc.java
@@ -114,14 +114,13 @@ final class CheckJSDoc extends AbstractPostOrderCallback implements CompilerPass
       }
       return;
     }
-    if (!NodeUtil.isPrototypePropertyDeclaration(n.getParent())) {
-      return;
-    }
-    JSDocInfo jsdoc = n.getJSDocInfo();
-    if (jsdoc != null && jsdoc.isNoCollapse()) {
-      t.getCompiler().report(
-          t.makeError(n, MISPLACED_ANNOTATION, "@nocollapse",
-              "This JSDoc has no effect on prototype properties."));
+    JSDocInfo bestInfo = NodeUtil.getBestJSDocInfo(n);
+    if (bestInfo != null && bestInfo.isNoCollapse()
+        && (n.getType() == Token.GETELEM || n.getType() == Token.GETPROP)
+        && NodeUtil.isPrototypeProperty(n)) {
+      t.getCompiler().report(t.makeError(n, MISPLACED_ANNOTATION,
+          "@nocollapse", "This JSDoc has no effect on prototype"
+              + "properties."));
     }
   }
 
diff --git a/src/com/google/javascript/jscomp/CheckSuspiciousCode.java b/src/com/google/javascript/jscomp/CheckSuspiciousCode.java
index 69d67fe66..08ebbe8ac 100644
--- a/src/com/google/javascript/jscomp/CheckSuspiciousCode.java
+++ b/src/com/google/javascript/jscomp/CheckSuspiciousCode.java
@@ -18,7 +18,6 @@ package com.google.javascript.jscomp;
 
 import com.google.common.base.Preconditions;
 import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback;
-import com.google.javascript.jscomp.NodeUtil.ValueType;
 import com.google.javascript.rhino.Node;
 import com.google.javascript.rhino.Token;
 
@@ -132,7 +131,7 @@ final class CheckSuspiciousCode extends AbstractPostOrderCallback {
 
   private static boolean reportIfNonObject(
       NodeTraversal t, Node n, DiagnosticType diagnosticType) {
-    if (n.isAdd() || NodeUtil.getKnownValueType(n) != ValueType.UNDETERMINED) {
+    if (NodeUtil.isImmutableResult(n) || n.getType() == Token.NOT) {
       t.getCompiler().report(
           t.makeError(n.getParent(), diagnosticType));
       return true;
diff --git a/src/com/google/javascript/jscomp/ClosureOptimizePrimitives.java b/src/com/google/javascript/jscomp/ClosureOptimizePrimitives.java
index 1bdd09d08..f1b003c46 100644
--- a/src/com/google/javascript/jscomp/ClosureOptimizePrimitives.java
+++ b/src/com/google/javascript/jscomp/ClosureOptimizePrimitives.java
@@ -63,7 +63,7 @@ final class ClosureOptimizePrimitives implements CompilerPass {
   @Override
   public void process(Node externs, Node root) {
     FindObjectCreateCalls pass = new FindObjectCreateCalls();
-    NodeTraversal.traverseEs6(compiler, root, pass);
+    NodeTraversal.traverse(compiler, root, pass);
   }
 
   /**
diff --git a/src/com/google/javascript/jscomp/CollapseProperties.java b/src/com/google/javascript/jscomp/CollapseProperties.java
index 5005d7212..dfc3b41da 100644
--- a/src/com/google/javascript/jscomp/CollapseProperties.java
+++ b/src/com/google/javascript/jscomp/CollapseProperties.java
@@ -933,7 +933,7 @@ class CollapseProperties implements CompilerPass {
     // "this", it must be a constructor or documented with @this.
     if (docInfo == null ||
         (!docInfo.isConstructor() && !docInfo.hasThisType())) {
-      NodeTraversal.traverseEs6(compiler, function.getLastChild(),
+      NodeTraversal.traverse(compiler, function.getLastChild(),
           new NodeTraversal.AbstractShallowCallback() {
             @Override
             public void visit(NodeTraversal t, Node n, Node parent) {
diff --git a/src/com/google/javascript/jscomp/Compiler.java b/src/com/google/javascript/jscomp/Compiler.java
index 0f7bb2ac2..ae1a0586e 100644
--- a/src/com/google/javascript/jscomp/Compiler.java
+++ b/src/com/google/javascript/jscomp/Compiler.java
@@ -18,7 +18,6 @@ package com.google.javascript.jscomp;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
-import com.google.common.base.Joiner;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Supplier;
 import com.google.common.base.Throwables;
@@ -49,7 +48,6 @@ import com.google.javascript.rhino.Token;
 import com.google.javascript.rhino.TypeIRegistry;
 import com.google.javascript.rhino.jstype.JSTypeRegistry;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.file.FileSystems;
@@ -239,8 +237,6 @@ public class Compiler extends AbstractCompiler {
 
   private Set<String> externProperties = null;
 
-  private static final Joiner pathJoiner = Joiner.on(File.separator);
-
   /**
    * Creates a Compiler that reports errors and warnings to its logger.
    */
@@ -468,13 +464,6 @@ public class Compiler extends AbstractCompiler {
     return moduleName + "$fillFile";
   }
 
-  /**
-   * Creates an OS specific path string from parts
-   */
-  public static String joinPathParts(String... pathParts) {
-    return pathJoiner.join(pathParts);
-  }
-
   /**
    * Fill any empty modules with a place holder file. It makes any cross module
    * motion easier.
@@ -535,8 +524,7 @@ public class Compiler extends AbstractCompiler {
     return FileSystems.getDefault().getPath(base)
         .resolveSibling(relative)
         .normalize()
-        .toString()
-        .replace(File.separator, "/");
+        .toString();
   }
 
   /**
diff --git a/src/com/google/javascript/jscomp/ConstParamCheck.java b/src/com/google/javascript/jscomp/ConstParamCheck.java
index ba08792a8..c4a6928f8 100644
--- a/src/com/google/javascript/jscomp/ConstParamCheck.java
+++ b/src/com/google/javascript/jscomp/ConstParamCheck.java
@@ -40,7 +40,6 @@ class ConstParamCheck extends AbstractPostOrderCallback
     implements CompilerPass {
 
   private static final String CONST_FUNCTION_NAME = "goog.string.Const.from";
-  private static final String CONST_FUNCTION_NAME_COLLAPSED = "goog$string$Const$from";
 
   @VisibleForTesting
   static final DiagnosticType CONST_NOT_STRING_LITERAL_ERROR =
@@ -63,7 +62,7 @@ class ConstParamCheck extends AbstractPostOrderCallback
   @Override
   public void process(Node externs, Node root) {
     Preconditions.checkState(compiler.getLifeCycleStage().isNormalized());
-    NodeTraversal.traverseEs6(compiler, root, this);
+    NodeTraversal.traverse(compiler, root, this);
   }
 
   /**
@@ -84,8 +83,7 @@ class ConstParamCheck extends AbstractPostOrderCallback
         return;
       }
 
-      // Detect calls to an aliased goog.string.Const.
-      if (name.isName() && !name.matchesQualifiedName(CONST_FUNCTION_NAME_COLLAPSED)) {
+      if (name.isName()) {
         Scope scope = traversal.getScope();
         Var var = scope.getVar(name.getString());
         if (var == null) {
@@ -97,8 +95,8 @@ class ConstParamCheck extends AbstractPostOrderCallback
         }
       }
 
-      if (name.matchesQualifiedName(CONST_FUNCTION_NAME)
-          || name.matchesQualifiedName(CONST_FUNCTION_NAME_COLLAPSED)) {
+      // goog.string.Const.from('constant')
+      if (name.matchesQualifiedName(CONST_FUNCTION_NAME)) {
         checkArgumentConstant(traversal, argument);
       }
     }
diff --git a/src/com/google/javascript/jscomp/CoverageInstrumentationPass.java b/src/com/google/javascript/jscomp/CoverageInstrumentationPass.java
index 22cb924cd..c80609c33 100644
--- a/src/com/google/javascript/jscomp/CoverageInstrumentationPass.java
+++ b/src/com/google/javascript/jscomp/CoverageInstrumentationPass.java
@@ -86,7 +86,7 @@ class CoverageInstrumentationPass implements CompilerPass {
   @Override
   public void process(Node externsNode, Node rootNode) {
     if (rootNode.hasChildren()) {
-      NodeTraversal.traverseEs6(compiler, rootNode,
+      NodeTraversal.traverse(compiler, rootNode,
           new CoverageInstrumentationCallback(instrumentationData, reach));
 
       Node firstScript = rootNode.getFirstChild();
diff --git a/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java b/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java
index 7258befa0..337e908dc 100644
--- a/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java
+++ b/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java
@@ -260,7 +260,7 @@ class CrossModuleCodeMotion implements CompilerPass {
     // Recursive definition should not block movement.
     String name = ref.getNode().getString();
     boolean recursive = false;
-    Node rootNode = ref.getScope().getRootNode().getParent();
+    Node rootNode = ref.getScope().getRootNode();
     if (rootNode.isFunction()) {
 
       // CASE #1:
@@ -308,7 +308,7 @@ class CrossModuleCodeMotion implements CompilerPass {
                 !compiler.getCodingConvention().isExported(var.getName());
           }
         });
-    NodeTraversal.traverseEs6(compiler, root, collector);
+    NodeTraversal.traverse(compiler, root, collector);
 
     for (Var v : collector.getAllSymbols()) {
       ReferenceCollection refCollection = collector.getReferences(v);
diff --git a/src/com/google/javascript/jscomp/DefaultPassConfig.java b/src/com/google/javascript/jscomp/DefaultPassConfig.java
index e8ac5c866..09b110f78 100644
--- a/src/com/google/javascript/jscomp/DefaultPassConfig.java
+++ b/src/com/google/javascript/jscomp/DefaultPassConfig.java
@@ -230,10 +230,6 @@ public final class DefaultPassConfig extends PassConfig {
       checks.add(jqueryAliases);
     }
 
-    if (options.angularPass && !options.skipNonTranspilationPasses) {
-      checks.add(angularPass);
-    }
-
     if (options.getLanguageIn() == LanguageMode.ECMASCRIPT6_TYPED
         && options.getLanguageOut() != LanguageMode.ECMASCRIPT6_TYPED) {
       checks.add(convertEs6TypedToEs6);
@@ -250,6 +246,10 @@ public final class DefaultPassConfig extends PassConfig {
       checks.add(es6RewriteDestructuring);
     }
 
+    if (options.angularPass && !options.skipNonTranspilationPasses) {
+      checks.add(angularPass);
+    }
+
     if (options.generateExports && !options.skipNonTranspilationPasses) {
       checks.add(generateExports);
     }
diff --git a/src/com/google/javascript/jscomp/DisambiguatePrivateProperties.java b/src/com/google/javascript/jscomp/DisambiguatePrivateProperties.java
index 739cbd6a9..77312c39c 100644
--- a/src/com/google/javascript/jscomp/DisambiguatePrivateProperties.java
+++ b/src/com/google/javascript/jscomp/DisambiguatePrivateProperties.java
@@ -41,7 +41,7 @@ class DisambiguatePrivateProperties
 
   @Override
   public void process(Node externs, Node root) {
-    NodeTraversal.traverseEs6(compiler, root, this);
+    NodeTraversal.traverse(compiler, root, this);
   }
 
   @Override
diff --git a/src/com/google/javascript/jscomp/DisambiguateProperties.java b/src/com/google/javascript/jscomp/DisambiguateProperties.java
index f8a305c87..c2910b722 100644
--- a/src/com/google/javascript/jscomp/DisambiguateProperties.java
+++ b/src/com/google/javascript/jscomp/DisambiguateProperties.java
@@ -318,10 +318,10 @@ class DisambiguateProperties<T> implements CompilerPass {
       addInvalidatingType(mis.typeB, mis.src);
     }
     // Gather names of properties in externs; these properties can't be renamed.
-    NodeTraversal.traverseEs6(compiler, externs, new FindExternProperties());
+    NodeTraversal.traverse(compiler, externs, new FindExternProperties());
     // Look at each unquoted property access and decide if that property will
     // be renamed.
-    NodeTraversal.traverseEs6(compiler, root, new FindRenameableProperties());
+    NodeTraversal.traverse(compiler, root, new FindRenameableProperties());
     // Do the actual renaming.
     renameProperties();
   }
diff --git a/src/com/google/javascript/jscomp/GatherExternProperties.java b/src/com/google/javascript/jscomp/GatherExternProperties.java
index 69d01cce5..bfab5340e 100644
--- a/src/com/google/javascript/jscomp/GatherExternProperties.java
+++ b/src/com/google/javascript/jscomp/GatherExternProperties.java
@@ -53,7 +53,7 @@ class GatherExternProperties extends AbstractPostOrderCallback
 
   @Override
   public void process(Node externs, Node root) {
-    NodeTraversal.traverseEs6(compiler, externs, this);
+    NodeTraversal.traverse(compiler, externs, this);
     compiler.setExternProperties(ImmutableSet.copyOf(externProperties));
   }
 
diff --git a/src/com/google/javascript/jscomp/GlobalTypeInfo.java b/src/com/google/javascript/jscomp/GlobalTypeInfo.java
index 88032765f..c61935aa6 100644
--- a/src/com/google/javascript/jscomp/GlobalTypeInfo.java
+++ b/src/com/google/javascript/jscomp/GlobalTypeInfo.java
@@ -2002,13 +2002,8 @@ class GlobalTypeInfo implements CompilerPass {
 
   private boolean isConst(Node defSite) {
     return isAnnotatedAsConst(defSite)
-        // Don't consider an all-caps variable in externs to be constant.
-        // 1) External code may not follow the coding convention.
-        // 2) We generate synthetic externs to export local properties,
-        //    which may be in all caps.
-        || (!defSite.isFromExterns()
-            && NodeUtil.isConstantByConvention(
-                this.convention, fromDefsiteToName(defSite)));
+        || NodeUtil.isConstantByConvention(
+            this.convention, fromDefsiteToName(defSite));
   }
 
   private static class PropertyDef {
diff --git a/src/com/google/javascript/jscomp/MarkNoSideEffectCalls.java b/src/com/google/javascript/jscomp/MarkNoSideEffectCalls.java
index 23419a04c..7113583e0 100644
--- a/src/com/google/javascript/jscomp/MarkNoSideEffectCalls.java
+++ b/src/com/google/javascript/jscomp/MarkNoSideEffectCalls.java
@@ -61,12 +61,12 @@ class MarkNoSideEffectCalls implements CompilerPass {
 
     // Gather the list of function nodes that have @nosideeffects annotations.
     // For use by SetNoSideEffectCallProperty.
-    NodeTraversal.traverseEs6(
+    NodeTraversal.traverse(
         compiler, externs, new GatherNoSideEffectFunctions(true));
-    NodeTraversal.traverseEs6(
+    NodeTraversal.traverse(
         compiler, root, new GatherNoSideEffectFunctions(false));
 
-    NodeTraversal.traverseEs6(compiler, root,
+    NodeTraversal.traverse(compiler, root,
                            new SetNoSideEffectCallProperty(defFinder));
   }
 
diff --git a/src/com/google/javascript/jscomp/NameAnalyzer.java b/src/com/google/javascript/jscomp/NameAnalyzer.java
index d4b608ee4..9430ee534 100644
--- a/src/com/google/javascript/jscomp/NameAnalyzer.java
+++ b/src/com/google/javascript/jscomp/NameAnalyzer.java
@@ -493,7 +493,7 @@ final class NameAnalyzer implements CompilerPass {
   private class FindDependencyScopes extends AbstractPostOrderCallback {
     @Override
     public void visit(NodeTraversal t, Node n, Node parent) {
-      if (!t.getScope().getClosestHoistScope().isGlobal()) {
+      if (!t.inGlobalScope()) {
         return;
       }
 
@@ -625,7 +625,7 @@ final class NameAnalyzer implements CompilerPass {
     public void visit(NodeTraversal t, Node n, Node parent) {
 
       // Record global variable and function declarations
-      if (t.getScope().getClosestHoistScope().isGlobal()) {
+      if (t.inGlobalScope()) {
         if (NodeUtil.isVarDeclaration(n)) {
           NameInformation ns = createNameInformation(t, n);
           Preconditions.checkNotNull(ns);
@@ -765,8 +765,10 @@ final class NameAnalyzer implements CompilerPass {
     }
 
     private void addSimplifiedChildren(Node n) {
-      NodeTraversal.traverseEs6(
-          compiler, n, new GatherSideEffectSubexpressionsCallback(compiler, new NodeAccumulator()));
+      NodeTraversal.traverse(
+          compiler, n,
+          new GatherSideEffectSubexpressionsCallback(
+              compiler, new NodeAccumulator()));
     }
 
     private void addSimplifiedExpression(Node n, Node parent) {
@@ -1122,11 +1124,12 @@ final class NameAnalyzer implements CompilerPass {
 
   @Override
   public void process(Node externs, Node root) {
-    NodeTraversal.traverseEs6(compiler, externs, new ProcessExternals());
-    NodeTraversal.traverseEs6(compiler, root, new FindDependencyScopes());
-    NodeTraversal.traverseEs6(compiler, root, new HoistVariableAndFunctionDeclarations());
-    NodeTraversal.traverseEs6(compiler, root, new FindDeclarationsAndSetters());
-    NodeTraversal.traverseEs6(compiler, root, new FindReferences());
+    NodeTraversal.traverse(compiler, externs, new ProcessExternals());
+    NodeTraversal.traverse(compiler, root, new FindDependencyScopes());
+    NodeTraversal.traverse(
+        compiler, root, new HoistVariableAndFunctionDeclarations());
+    NodeTraversal.traverse(compiler, root, new FindDeclarationsAndSetters());
+    NodeTraversal.traverse(compiler, root, new FindReferences());
 
     // Create bi-directional references between parent names and their
     // descendants. This may create new names.
@@ -1759,11 +1762,12 @@ final class NameAnalyzer implements CompilerPass {
    */
   private List<Node> getSideEffectNodes(Node n) {
     List<Node> subexpressions = new ArrayList<>();
-    NodeTraversal.traverseEs6(
-        compiler,
-        n,
+    NodeTraversal.traverse(
+        compiler, n,
         new GatherSideEffectSubexpressionsCallback(
-            compiler, new GetReplacementSideEffectSubexpressions(compiler, subexpressions)));
+            compiler,
+            new GetReplacementSideEffectSubexpressions(
+                compiler, subexpressions)));
 
     List<Node> replacements = new ArrayList<>(subexpressions.size());
     for (Node subexpression : subexpressions) {
diff --git a/src/com/google/javascript/jscomp/NodeTraversal.java b/src/com/google/javascript/jscomp/NodeTraversal.java
index be996fdcf..e722637f4 100644
--- a/src/com/google/javascript/jscomp/NodeTraversal.java
+++ b/src/com/google/javascript/jscomp/NodeTraversal.java
@@ -533,8 +533,7 @@ public class NodeTraversal {
           }
           return true;
         }
-      },
-      new Es6SyntacticScopeCreator(compiler));
+      });
     t.traverse(jsRoot);
   }
 
diff --git a/src/com/google/javascript/jscomp/NodeUtil.java b/src/com/google/javascript/jscomp/NodeUtil.java
index df1d9caf9..18ac93bde 100644
--- a/src/com/google/javascript/jscomp/NodeUtil.java
+++ b/src/com/google/javascript/jscomp/NodeUtil.java
@@ -517,15 +517,6 @@ public final class NodeUtil {
    * Returns true if this is an immutable value.
    */
   static boolean isImmutableValue(Node n) {
-    // TODO(johnlenz): rename this function.  It is currently being used
-    // in two disjoint cases:
-    // 1) We only care about the result of the expression
-    //    (in which case NOT here should return true)
-    // 2) We care that expression is a side-effect free and can't
-    //    be side-effected by other expressions.
-    // This should only be used to say the value is immuable and
-    // hasSideEffects and canBeSideEffected should be used for the other case.
-
     switch (n.getType()) {
       case Token.STRING:
       case Token.NUMBER:
diff --git a/src/com/google/javascript/jscomp/OptimizeArgumentsArray.java b/src/com/google/javascript/jscomp/OptimizeArgumentsArray.java
index 99bd12768..8967dbff2 100644
--- a/src/com/google/javascript/jscomp/OptimizeArgumentsArray.java
+++ b/src/com/google/javascript/jscomp/OptimizeArgumentsArray.java
@@ -89,7 +89,7 @@ class OptimizeArgumentsArray implements CompilerPass, ScopedCallback {
 
   @Override
   public void process(Node externs, Node root) {
-    NodeTraversal.traverseEs6(compiler, Preconditions.checkNotNull(root), this);
+    NodeTraversal.traverse(compiler, Preconditions.checkNotNull(root), this);
   }
 
   @Override
@@ -122,11 +122,6 @@ class OptimizeArgumentsArray implements CompilerPass, ScopedCallback {
       return;
     }
 
-    Node function = traversal.getScopeRoot();
-    if (!function.isFunction()) {
-      return;
-    }
-
     // Attempt to replace the argument access and if the AST has been change,
     // report back to the compiler.
     if (tryReplaceArguments(traversal.getScope())) {
diff --git a/src/com/google/javascript/jscomp/PeepholeOptimizationsPass.java b/src/com/google/javascript/jscomp/PeepholeOptimizationsPass.java
index 3404d44db..a79541259 100644
--- a/src/com/google/javascript/jscomp/PeepholeOptimizationsPass.java
+++ b/src/com/google/javascript/jscomp/PeepholeOptimizationsPass.java
@@ -63,7 +63,7 @@ class PeepholeOptimizationsPass implements CompilerPass {
           }
           do {
             handler.reset();
-            NodeTraversal.traverseEs6(compiler, root, new PeepCallback());
+            NodeTraversal.traverse(compiler, root, new PeepCallback());
           } while (retraverseOnChange && handler.hasCodeChanged());
         }
       });
diff --git a/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java b/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java
index 6e3cbb5ba..0c6e38ecf 100644
--- a/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java
+++ b/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java
@@ -498,7 +498,7 @@ class ProcessClosurePrimitives extends AbstractPostOrderCallback
       NodeTraversal t, Node n, Node parent) {
     if (!t.inFunction()) {
       String name = null;
-      if (n.isName() && NodeUtil.isNameDeclaration(parent)) {
+      if (n.isName() && parent.isVar()) {
         name = n.getString();
       } else if (n.isAssign() &&
           parent.isExprResult()) {
@@ -1274,7 +1274,7 @@ class ProcessClosurePrimitives extends AbstractPostOrderCallback
     void addDefinition(Node node, JSModule module) {
       Preconditions.checkArgument(node.isExprResult() || // assign
                                   node.isFunction() ||
-                                  NodeUtil.isNameDeclaration(node));
+                                  node.isVar());
       Preconditions.checkArgument(explicitNode != node);
       if ((candidateDefinition == null) || !node.isExprResult()) {
         candidateDefinition = node;
diff --git a/src/com/google/javascript/jscomp/ProcessEs6Modules.java b/src/com/google/javascript/jscomp/ProcessEs6Modules.java
index 2e6b45bad..c83bcc4a9 100644
--- a/src/com/google/javascript/jscomp/ProcessEs6Modules.java
+++ b/src/com/google/javascript/jscomp/ProcessEs6Modules.java
@@ -307,18 +307,6 @@ public final class ProcessEs6Modules extends AbstractPostOrderCallback {
     URI normalizedAddress = loader.normalizeInputAddress(t.getInput());
     String moduleName = ES6ModuleLoader.toModuleName(normalizedAddress);
 
-    if (!exportMap.isEmpty()) {
-      // Creates an export object for this module.
-      // var moduleName = {};
-      Node objectlit = IR.objectlit();
-      Node varNode = IR.var(IR.name(moduleName), objectlit)
-          .useSourceInfoIfMissingFromForTree(script);
-      JSDocInfoBuilder info = new JSDocInfoBuilder(true);
-      info.recordConstancy();
-      varNode.setJSDocInfo(info.build());
-      script.addChildToBack(varNode);
-    }
-
     for (Map.Entry<String, NameNodePair> entry : exportMap.entrySet()) {
       String exportedName = entry.getKey();
       String withSuffix = entry.getValue().name;
diff --git a/src/com/google/javascript/jscomp/ReplaceStrings.java b/src/com/google/javascript/jscomp/ReplaceStrings.java
index 963a93d51..52222b0c3 100644
--- a/src/com/google/javascript/jscomp/ReplaceStrings.java
+++ b/src/com/google/javascript/jscomp/ReplaceStrings.java
@@ -181,7 +181,7 @@ class ReplaceStrings extends AbstractPostOrderCallback
 
   @Override
   public void process(Node externs, Node root) {
-    NodeTraversal.traverseEs6(compiler, root, this);
+    NodeTraversal.traverse(compiler, root, this);
   }
 
   @Override
diff --git a/src/com/google/javascript/jscomp/RuntimeTypeCheck.java b/src/com/google/javascript/jscomp/RuntimeTypeCheck.java
index 1263dc2ff..91d7062a5 100644
--- a/src/com/google/javascript/jscomp/RuntimeTypeCheck.java
+++ b/src/com/google/javascript/jscomp/RuntimeTypeCheck.java
@@ -78,8 +78,8 @@ class RuntimeTypeCheck implements CompilerPass {
 
   @Override
   public void process(Node externs, Node root) {
-    NodeTraversal.traverseEs6(compiler, root, new AddMarkers(compiler));
-    NodeTraversal.traverseEs6(compiler, root, new AddChecks());
+    NodeTraversal.traverse(compiler, root, new AddMarkers(compiler));
+    NodeTraversal.traverse(compiler, root, new AddChecks());
     addBoilerplateCode();
     new Normalize(compiler, false).process(externs, root);
   }
diff --git a/src/com/google/javascript/jscomp/SimpleDefinitionFinder.java b/src/com/google/javascript/jscomp/SimpleDefinitionFinder.java
index 57513eab2..e0753cd60 100644
--- a/src/com/google/javascript/jscomp/SimpleDefinitionFinder.java
+++ b/src/com/google/javascript/jscomp/SimpleDefinitionFinder.java
@@ -103,11 +103,11 @@ class SimpleDefinitionFinder implements CompilerPass, DefinitionProvider {
 
   @Override
   public void process(Node externs, Node source) {
-    NodeTraversal.traverseEs6(
+    NodeTraversal.traverse(
         compiler, externs, new DefinitionGatheringCallback(true));
-    NodeTraversal.traverseEs6(
+    NodeTraversal.traverse(
         compiler, source, new DefinitionGatheringCallback(false));
-    NodeTraversal.traverseEs6(
+    NodeTraversal.traverse(
         compiler, source, new UseSiteGatheringCallback());
   }
 
diff --git a/src/com/google/javascript/jscomp/SourceFile.java b/src/com/google/javascript/jscomp/SourceFile.java
index 9b3c8c5a4..5ddcccc2d 100644
--- a/src/com/google/javascript/jscomp/SourceFile.java
+++ b/src/com/google/javascript/jscomp/SourceFile.java
@@ -83,12 +83,7 @@ public class SourceFile implements StaticSourceFile, Serializable {
     if (fileName == null || fileName.isEmpty()) {
       throw new IllegalArgumentException("a source must have a name");
     }
-
-    if (!"/".equals(File.separator)) {
-      this.fileName = fileName.replace(File.separator, "/");
-    } else {
-      this.fileName = fileName;
-    }
+    this.fileName = fileName;
   }
 
   @Override
diff --git a/src/com/google/javascript/jscomp/SourceMap.java b/src/com/google/javascript/jscomp/SourceMap.java
index 482e0950a..5aa569bb1 100644
--- a/src/com/google/javascript/jscomp/SourceMap.java
+++ b/src/com/google/javascript/jscomp/SourceMap.java
@@ -23,6 +23,7 @@ import com.google.debugging.sourcemap.SourceMapGenerator;
 import com.google.debugging.sourcemap.SourceMapGeneratorFactory;
 import com.google.javascript.rhino.Node;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
@@ -138,6 +139,11 @@ public final class SourceMap {
    * @return a remapped source file.
    */
   private String fixupSourceLocation(String sourceFile) {
+    // Replace backslashes (the file separator used on Windows systems).
+    if (File.separatorChar == '\\') {
+      sourceFile = sourceFile.replace('\\', '/');
+    }
+
     if (prefixMappings.isEmpty()) {
       return sourceFile;
     }
diff --git a/src/com/google/javascript/rhino/Node.java b/src/com/google/javascript/rhino/Node.java
index e3f3bc3e3..d91e91453 100644
--- a/src/com/google/javascript/rhino/Node.java
+++ b/src/com/google/javascript/rhino/Node.java
@@ -1579,8 +1579,8 @@ public class Node implements Serializable {
         return "Node tree inequality:" +
             "\nTree1:\n" + toStringTree() +
             "\n\nTree2:\n" + actual.toStringTree() +
-            "\n\nSubtree1: " + diff.nodeActual.toStringTree() +
-            "\n\nSubtree2: " + diff.nodeExpected.toStringTree();
+            "\n\nSubtree1: " + diff.nodeA.toStringTree() +
+            "\n\nSubtree2: " + diff.nodeB.toStringTree();
       }
       return null;
   }
@@ -1598,28 +1598,28 @@ public class Node implements Serializable {
   public String checkTreeEqualsIncludingJsDoc(Node actual) {
       NodeMismatch diff = checkTreeEqualsImpl(actual, true);
       if (diff != null) {
-        if (diff.nodeActual.isEquivalentTo(diff.nodeExpected, false, true, false)) {
+        if (diff.nodeA.isEquivalentTo(diff.nodeB, false, true, false)) {
           // The only difference is that the JSDoc is different on
           // the subtree.
-          String jsDocActual = diff.nodeActual.getJSDocInfo() == null ?
+          String jsDoc1 = diff.nodeA.getJSDocInfo() == null ?
               "(none)" :
-              diff.nodeActual.getJSDocInfo().toStringVerbose();
+              diff.nodeA.getJSDocInfo().toStringVerbose();
 
-          String jsDocExpected = diff.nodeExpected.getJSDocInfo() == null ?
+          String jsDoc2 = diff.nodeB.getJSDocInfo() == null ?
               "(none)" :
-              diff.nodeExpected.getJSDocInfo().toStringVerbose();
+              diff.nodeB.getJSDocInfo().toStringVerbose();
 
           return "Node tree inequality:" +
               "\nTree:\n" + toStringTree() +
-              "\n\nJSDoc differs on subtree: " + diff.nodeActual +
-              "\nExpected JSDoc: " + jsDocExpected +
-              "\nActual JSDoc  : " + jsDocActual;
+              "\n\nJSDoc differs on subtree: " + diff.nodeA +
+              "\nExpected JSDoc: " + jsDoc1 +
+              "\nActual JSDoc  : " + jsDoc2;
         }
         return "Node tree inequality:" +
             "\nExpected tree:\n" + toStringTree() +
             "\n\nActual tree:\n" + actual.toStringTree() +
-            "\n\nExpected subtree: " + diff.nodeExpected.toStringTree() +
-            "\n\nActual subtree: " + diff.nodeActual.toStringTree();
+            "\n\nExpected subtree: " + diff.nodeA.toStringTree() +
+            "\n\nActual subtree: " + diff.nodeB.toStringTree();
       }
       return null;
   }
@@ -2521,27 +2521,26 @@ public class Node implements Serializable {
   }
 
   static class NodeMismatch {
-    final Node nodeActual;
-    final Node nodeExpected;
+    final Node nodeA;
+    final Node nodeB;
 
-    NodeMismatch(Node nodeActual, Node nodeExpected) {
-      this.nodeActual = nodeActual;
-      this.nodeExpected = nodeExpected;
+    NodeMismatch(Node nodeA, Node nodeB) {
+      this.nodeA = nodeA;
+      this.nodeB = nodeB;
     }
 
     @Override
     public boolean equals(Object object) {
       if (object instanceof NodeMismatch) {
         NodeMismatch that = (NodeMismatch) object;
-        return that.nodeActual.equals(this.nodeActual)
-            && that.nodeExpected.equals(this.nodeExpected);
+        return that.nodeA.equals(this.nodeA) && that.nodeB.equals(this.nodeB);
       }
       return false;
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(nodeActual, nodeExpected);
+      return Objects.hashCode(nodeA, nodeB);
     }
   }
 


Test patch:
diff --git a/test/com/google/javascript/jscomp/AngularPassTest.java b/test/com/google/javascript/jscomp/AngularPassTest.java
index aed460835..0a2b47335 100644
--- a/test/com/google/javascript/jscomp/AngularPassTest.java
+++ b/test/com/google/javascript/jscomp/AngularPassTest.java
@@ -311,29 +311,4 @@ public final class AngularPassTest extends Es6CompilerTestCase {
             "}"),
         AngularPass.INJECT_NON_FUNCTION_ERROR);
   }
-
-  public void testNgInjectToArrowFunctions() {
-    testEs6("/** @ngInject */ var fn = (a, b, c)=>{};",
-        "var fn = (a, b, c)=>{}; fn['$inject']=['a', 'b', 'c'];");
-    testEs6("/** @ngInject */ var fn = ()=>{}",
-            "var fn = ()=>{}");
-  }
-
-  public void testNgInjectToFunctionsWithDestructuredParam() {
-    testErrorEs6("/** @ngInject */ function fn(a, {b, c}){}",
-        AngularPass.INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM);
-    testErrorEs6("/** @ngInject */ function fn(a, [b, c]){}",
-        AngularPass.INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM);
-    testErrorEs6("/** @ngInject */ function fn(a, {b, c}, d){}",
-        AngularPass.INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM);
-  }
-
-  public void testNgInjectToFunctionsWithDefaultValue() {
-    testErrorEs6("/** @ngInject */ function fn(a, b = 1){}",
-        AngularPass.INJECTED_FUNCTION_HAS_DEFAULT_VALUE);
-    testErrorEs6("/** @ngInject */ function fn(a, {b, c} = {b: 1, c: 2}){}",
-        AngularPass.INJECTED_FUNCTION_HAS_DEFAULT_VALUE);
-    testErrorEs6("/** @ngInject */ function fn(a, [b, c] = [1, 2]){}",
-        AngularPass.INJECTED_FUNCTION_HAS_DEFAULT_VALUE);
-  }
 }
diff --git a/test/com/google/javascript/jscomp/CheckAccessControlsTest.java b/test/com/google/javascript/jscomp/CheckAccessControlsTest.java
index f47df173a..2f69c177d 100644
--- a/test/com/google/javascript/jscomp/CheckAccessControlsTest.java
+++ b/test/com/google/javascript/jscomp/CheckAccessControlsTest.java
@@ -678,14 +678,14 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */\n"
                 + "function Parent() {\n"
                 + "/** @package */\n"
                 + "this.prop = 'foo';\n"
                 + "}\n;"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/**"
                 + " * @constructor\n"
                 + " * @extends {Parent}\n"
@@ -705,10 +705,9 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
 
   public void testPackagePrivateAccessForProperties2() {
     testSame(ImmutableList.of(
-        SourceFile.fromCode(Compiler.joinPathParts("foo", "bar.js"),
-            "/** @constructor */ function Foo() {}"),
+        SourceFile.fromCode("foo/bar.js", "/** @constructor */ function Foo() {}"),
         SourceFile.fromCode(
-            Compiler.joinPathParts("baz", "quux.js"),
+            "baz/quux.js",
             "/** @package */ Foo.prototype.bar = function() {};"
             + "Foo.prototype.baz = function() { this.bar(); }; (new Foo).bar();")));
   }
@@ -716,36 +715,34 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
   public void testPackagePrivateAccessForProperties3() {
     testSame(ImmutableList.of(
         SourceFile.fromCode(
-            Compiler.joinPathParts("foo", "bar.js"),
+            "foo/bar.js",
             "/** @constructor */ function Foo() {}"
             + "/** @package */ Foo.prototype.bar = function() {}; (new Foo).bar();"),
-        SourceFile.fromCode(Compiler.joinPathParts("foo", "baz.js"),
-            "Foo.prototype.baz = function() { this.bar(); };")));
+        SourceFile.fromCode("foo/baz.js", "Foo.prototype.baz = function() { this.bar(); };")));
   }
 
   public void testPackagePrivateAccessForProperties4() {
     testSame(ImmutableList.of(
         SourceFile.fromCode(
-            Compiler.joinPathParts("foo", "bar.js"),
+            "foo/bar.js",
             "/** @constructor */ function Foo() {}"
             + "/** @package */ Foo.prototype.bar = function() {};"),
         SourceFile.fromCode(
-            Compiler.joinPathParts("foo", "baz.js"),
-            "Foo.prototype['baz'] = function() { (new Foo()).bar(); };")));
+            "foo/baz.js", "Foo.prototype['baz'] = function() { (new Foo()).bar(); };")));
   }
 
   public void testPackagePrivateAccessForProperties5() {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */\n"
                 + "function Parent () {\n"
                 + "  /** @package */\n"
                 + "  this.prop = 'foo';\n"
                 + "};"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/**\n"
                 + " * @constructor\n"
                 + " * @extends {Parent}\n"
@@ -761,10 +758,9 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
-                "/** @constructor */ function Foo() {} (new Foo).bar();"),
+                "foo/bar.js", "/** @constructor */ function Foo() {} (new Foo).bar();"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/** @package */ Foo.prototype.bar = function() {};"
                 + "Foo.prototype.baz = function() { this.bar(); };")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
@@ -774,11 +770,11 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */ function Foo() {} "
                 + "/** @package */ Foo.prototype.bar = function() {};"
                 + "Foo.prototype.baz = function() { this.bar(); };"),
-            SourceFile.fromCode(Compiler.joinPathParts("baz", "quux.js"), "(new Foo).bar();")),
+            SourceFile.fromCode("baz/quux.js", "(new Foo).bar();")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
   }
 
@@ -786,12 +782,11 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */ function Foo() {} "
                 + "/** @package */ Foo.prototype.bar = function() {};"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
-                "/** @constructor */ function OtherFoo() { (new Foo).bar(); }")),
+                "baz/quux.js", "/** @constructor */ function OtherFoo() { (new Foo).bar(); }")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
   }
 
@@ -799,11 +794,11 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */ function Foo() {} "
                 + "/** @package */ Foo.prototype.bar = function() {};"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/** @constructor \n * @extends {Foo} */ "
                 + "function SubFoo() { this.bar(); }")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
@@ -813,10 +808,10 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @const */ var foo = {};\n"
                 + "/** @package */ foo.bar = function() {};"),
-            SourceFile.fromCode(Compiler.joinPathParts("baz", "quux.js"), "foo.bar();")),
+            SourceFile.fromCode("baz/quux.js", "foo.bar();")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
   }
 
@@ -824,11 +819,11 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */ function Foo() {} "
                 + "/** @package */ Foo.prototype.bar = function() {};"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/** @constructor \n * @extends {Foo} */ "
                 + "function SubFoo() {};"
                 + "SubFoo.prototype.baz = function() { this.bar(); }")),
@@ -841,11 +836,11 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */ function Foo() {} "
                 + "/** @package */ Foo.prototype.bar = function() {};"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/** @constructor \n * @extends {Foo} */ "
                 + "function SubFoo() {};"
                 + "SubFoo.prototype.bar = function() {};")),
@@ -859,15 +854,14 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/** @constructor */ function Foo() {} "
                 + "/** @package */ Foo.prototype.bar = function() {};"
                 + "/** @constructor \n * @extends {Foo} */ "
                 + "function SubFoo() {};"
                 + "SubFoo.prototype.bar = function() {};"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
-                "SubFoo.prototype.baz = function() { this.bar(); }")),
+                "baz/quux.js", "SubFoo.prototype.baz = function() { this.bar(); }")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
   }
 
@@ -976,40 +970,40 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @public\n"
                 + " */\n"
                 + "/** @constructor @package */ function Foo() {};"),
-            SourceFile.fromCode(Compiler.joinPathParts("baz", "quux.js"), "new Foo();")),
+            SourceFile.fromCode("baz/quux.js", "new Foo();")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
   }
 
   public void testPackageFileOverviewVisibilityDoesNotApplyToNameWithExplicitPublicVisibility() {
     testSame(ImmutableList.of(
         SourceFile.fromCode(
-            Compiler.joinPathParts("foo", "bar.js"),
+            "foo/bar.js",
             "/**\n"
             + " * @fileoverview\n"
             + " * @package\n"
             + " */\n"
             + "/** @constructor @public */ function Foo() {};"),
-        SourceFile.fromCode(Compiler.joinPathParts("baz", "quux.js"), "new Foo();")));
+        SourceFile.fromCode("baz/quux.js", "new Foo();")));
   }
 
   public void testPackageFileOverviewVisibilityAppliesToNameWithoutExplicitVisibility() {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @package\n"
                 + " */\n"
                 + "/** @constructor */\n"
                 + "var Foo = function() {};\n"),
-            SourceFile.fromCode(Compiler.joinPathParts("baz", "quux.js"), "new Foo();")),
+            SourceFile.fromCode("baz/quux.js", "new Foo();")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
   }
 
@@ -1017,7 +1011,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
       testPackageFileOverviewVisibilityDoesNotApplyToPropertyWithExplicitPublicVisibility() {
     testSame(ImmutableList.of(
         SourceFile.fromCode(
-            Compiler.joinPathParts("foo", "bar.js"),
+            "foo/bar.js",
             "/**\n"
             + " * @fileoverview\n"
             + " * @package\n"
@@ -1027,7 +1021,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
             + "/** @public */\n"
             + "Foo.prototype.bar = function() {};\n"),
         SourceFile.fromCode(
-            Compiler.joinPathParts("baz", "quux.js"),
+            "baz/quux.js",
             "var foo = new Foo();\n"
             + "foo.bar();")));
   }
@@ -1041,7 +1035,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
         ImmutableList.of(
             SourceFile.fromCode("foo.js", "goog.provide('foo');"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + "  * @fileoverview\n"
                 + "  * @package\n"
@@ -1049,8 +1043,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
                 + "goog.provide('foo.bar');"),
             SourceFile.fromCode("bar.js", "goog.require('foo')")),
         ImmutableList.of(SourceFile.fromCode("foo.js", "var foo={};"),
-            SourceFile.fromCode(Compiler.joinPathParts("foo", "bar.js"), "foo.bar={};"),
-            SourceFile.fromCode("bar.js", "")),
+            SourceFile.fromCode("foo/bar.js", "foo.bar={};"), SourceFile.fromCode("bar.js", "")),
         null, null);
 
     compareJsDoc = true;
@@ -1064,7 +1057,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + "  * @fileoverview\n"
                 + "  * @package\n"
@@ -1075,8 +1068,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
                 "bar.js",
                 "goog.require('foo');\n"
                 + "var x = foo;")),
-        ImmutableList.of(SourceFile.fromCode(Compiler.joinPathParts("foo", "bar.js"),
-                "var foo={};foo.bar={};"),
+        ImmutableList.of(SourceFile.fromCode("foo/bar.js", "var foo={};foo.bar={};"),
             SourceFile.fromCode("foo.js", ""), SourceFile.fromCode("bar.js", "var x=foo")),
         null, null);
 
@@ -1091,7 +1083,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @package\n"
@@ -1103,8 +1095,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
                 "goog.require('one.two');\n"
                 + "var x = one.two;")),
         ImmutableList.of(
-            SourceFile.fromCode(Compiler.joinPathParts("foo", "bar.js"),
-                "var one={};one.two={};one.two.three=function(){};"),
+            SourceFile.fromCode("foo/bar.js", "var one={};one.two={};one.two.three=function(){};"),
             SourceFile.fromCode("baz.js", "var x=one.two")),
         null, null);
 
@@ -1115,7 +1106,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @package\n"
@@ -1134,7 +1125,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @public\n"
@@ -1144,7 +1135,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
                 + "/** @package */\n"
                 + "Foo.prototype.bar = function() {};\n"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "var foo = new Foo();\n"
                 + "foo.bar();")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
@@ -1153,7 +1144,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
   public void testPublicFileOverviewVisibilityAppliesToPropertyWithoutExplicitVisibility() {
     testSame(ImmutableList.of(
         SourceFile.fromCode(
-            Compiler.joinPathParts("foo", "bar.js"),
+            "foo/bar.js",
             "/**\n"
             + " * @fileoverview\n"
             + " * @public\n"
@@ -1162,7 +1153,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
             + "Foo = function() {};\n"
             + "Foo.prototype.bar = function() {};\n"),
         SourceFile.fromCode(
-            Compiler.joinPathParts("baz", "quux.js"),
+            "baz/quux.js",
             "var foo = new Foo();\n"
             + "foo.bar();")));
   }
@@ -1171,7 +1162,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @package\n"
@@ -1180,7 +1171,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
                 + "Foo = function() {};\n"
                 + "Foo.prototype.bar = function() {};\n"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "var foo = new Foo();\n"
                 + "foo.bar();")),
         null, BAD_PACKAGE_PROPERTY_ACCESS);
@@ -1190,7 +1181,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
     test(
         ImmutableList.of(
             SourceFile.fromCode(
-                Compiler.joinPathParts("foo", "bar.js"),
+                "foo/bar.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @package\n"
@@ -1199,7 +1190,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
                 + "Foo = function() {};\n"
                 + "Foo.prototype.bar = function() {};\n"),
             SourceFile.fromCode(
-                Compiler.joinPathParts("baz", "quux.js"),
+                "baz/quux.js",
                 "/**\n"
                 + " * @fileoverview\n"
                 + " * @public\n"
@@ -1360,7 +1351,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
 
   public void testDeclarationAndConventionConflict1() {
     testError(
-        "/** @constructor */ function Foo() {} /** @protected */ Foo.prototype.length_;",
+        "/** @constructor */ function Foo() {}" + "/** @protected */ Foo.prototype.length_;",
         CONVENTION_MISMATCH);
   }
 
@@ -1373,7 +1364,7 @@ public final class CheckAccessControlsTest extends CompilerTestCase {
 
   public void testDeclarationAndConventionConflict3() {
     testError(
-        "/** @constructor */ function Foo() {  /** @protected */ this.length_ = 1;\n}\n",
+        "/** @constructor */ function Foo() {" + "  /** @protected */ this.length_ = 1;\n" + "}\n",
         CONVENTION_MISMATCH);
   }
 
diff --git a/test/com/google/javascript/jscomp/CheckJsDocTest.java b/test/com/google/javascript/jscomp/CheckJsDocTest.java
index 308b579b8..29bcb70f0 100644
--- a/test/com/google/javascript/jscomp/CheckJsDocTest.java
+++ b/test/com/google/javascript/jscomp/CheckJsDocTest.java
@@ -143,17 +143,10 @@ public final class CheckJsDocTest extends Es6CompilerTestCase {
         MISPLACED_ANNOTATION);
   }
 
-  public void testAllowedNocollapseAnnotation1() {
+  public void testAllowedNocollapseAnnotation() {
     testSame("var foo = {}; /** @nocollapse */ foo.bar = true;");
   }
 
-  public void testAllowedNocollapseAnnotation2() {
-    testSame(
-        "/** @constructor */ function Foo() {};\n"
-        + "var ns = {};\n"
-        + "/** @nocollapse */ ns.bar = Foo.prototype.blah;");
-  }
-
   public void testMisplacedNocollapseAnnotation1() {
     testWarning(
         "/** @constructor */ function foo() {};"
diff --git a/test/com/google/javascript/jscomp/CheckSuspiciousCodeTest.java b/test/com/google/javascript/jscomp/CheckSuspiciousCodeTest.java
index 2631734b8..60ae8f347 100644
--- a/test/com/google/javascript/jscomp/CheckSuspiciousCodeTest.java
+++ b/test/com/google/javascript/jscomp/CheckSuspiciousCodeTest.java
@@ -16,10 +16,12 @@
 
 package com.google.javascript.jscomp;
 
+import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
+
 /**
  * Tests for CheckSuspiciousCode
  */
-public final class CheckSuspiciousCodeTest extends Es6CompilerTestCase {
+public final class CheckSuspiciousCodeTest extends CompilerTestCase {
   public CheckSuspiciousCodeTest() {
     this.parseTypeInfo = true;
   }
@@ -42,62 +44,63 @@ public final class CheckSuspiciousCodeTest extends Es6CompilerTestCase {
   public void testSuspiciousSemi() {
     final DiagnosticType e = CheckSuspiciousCode.SUSPICIOUS_SEMICOLON;
 
-    testSame("if(x()) x = y;");
-    testWarning("if(x()); x = y;", e);  // I've had this bug, damned ;
-    testSame("if(x()){} x = y;");
-
-    testSame("if(x()) x = y; else y=z;");
-    testWarning("if(x()); else y=z;", e);
-    testSame("if(x()){} else y=z;");
-    testWarning("if(x()) x = y; else;", e);
-    testSame("if(x()) x = y; else {}");
-
-    testSame("while(x()) x = y;");
-    testWarning("while(x()); x = y;", e);
-    testSame("while(x()){} x = y;");
-    testWarning("while(x()); {x = y}", e);
-    testSame("while(x()){} {x = y}");
-
-    testSame("for(;;) x = y;");
-    testWarning("for(;;); x = y;", e);
-    testSame("for(;;){} x = y;");
-    testSame("for(x in y) x = y;");
-    testWarning("for(x in y); x = y;", e);
-    testSame("for(x in y){} x = y;");
-
-    testSameEs6("var y = [1, 2, 3]; for(x of y) console.log(x);");
-    testWarningEs6("var y = [1, 2, 3]; for(x of y); console.log(x);", e);
-    testSameEs6("var y = [1, 2, 3]; for(x of y){} console.log(x);");
+    testOk("if(x()) x = y;");
+    test("if(x()); x = y;", e);  // I've had this bug, damned ;
+    testOk("if(x()){} x = y;");
+
+    testOk("if(x()) x = y; else y=z;");
+    test("if(x()); else y=z;", e);
+    testOk("if(x()){} else y=z;");
+    test("if(x()) x = y; else;", e);
+    testOk("if(x()) x = y; else {}");
+
+    testOk("while(x()) x = y;");
+    test("while(x()); x = y;", e);
+    testOk("while(x()){} x = y;");
+    test("while(x()); {x = y}", e);
+    testOk("while(x()){} {x = y}");
+
+    testOk("for(;;) x = y;");
+    test("for(;;); x = y;", e);
+    testOk("for(;;){} x = y;");
+    testOk("for(x in y) x = y;");
+    test("for(x in y); x = y;", e);
+    testOk("for(x in y){} x = y;");
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    testOk("var y = [1, 2, 3]; for(x of y) console.log(x);");
+    test("var y = [1, 2, 3]; for(x of y); console.log(x);", e);
+    testOk("var y = [1, 2, 3]; for(x of y){} console.log(x);");
   }
 
   public void testSuspiciousIn() {
-    testWarning("'foo' in 1", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in 'test'", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in NaN", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in undefined", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in Infinity", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in true", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in false", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in null", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testWarning("'foo' in !Object", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
-    testSame("'foo' in Object");
-    testSame("'foo' in {}");
+    testSame("'foo' in 1", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in 'test'", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in NaN", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in undefined", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in Infinity", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in true", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in false", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in null", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in !Object", CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR);
+    testSame("'foo' in Object", null);
+    testSame("'foo' in {}", null);
   }
 
   public void testForOf() {
-    testSameEs6("var y = [1, 2, 3]; for (var x of y) console.log(x);");
-    testSameEs6("var y = [1, 2, 3]; for (var x of 'test') console.log(x);");
-    testSameEs6("for (var x of 123) console.log(x);");
-    testSameEs6("for (var x of false) console.log(x);");
-    testSameEs6("for (var x of true) console.log(x);");
-    testSameEs6("for (var x of undefined) console.log(x);");
-    testSameEs6("for (var x of NaN) console.log(x);");
-    testSameEs6("for (var x of Infinity) console.log(x);");
-    testSameEs6("for (var x of null) console.log(x);");
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    testSame("var y = [1, 2, 3]; for (var x of y) console.log(x);");
+    testSame("var y = [1, 2, 3]; for (var x of 'test') console.log(x);");
+    testSame("for (var x of 123) console.log(x);");
+    testSame("for (var x of false) console.log(x);");
+    testSame("for (var x of true) console.log(x);");
+    testSame("for (var x of undefined) console.log(x);");
+    testSame("for (var x of NaN) console.log(x);");
+    testSame("for (var x of Infinity) console.log(x);");
+    testSame("for (var x of null) console.log(x);");
   }
 
   private void testReportNaN(String js) {
-    testWarning(js, CheckSuspiciousCode.SUSPICIOUS_COMPARISON_WITH_NAN);
+    testSame(js, CheckSuspiciousCode.SUSPICIOUS_COMPARISON_WITH_NAN);
   }
 
   public void testComparison1() {
@@ -159,17 +162,6 @@ public final class CheckSuspiciousCodeTest extends Es6CompilerTestCase {
         "/** @constructor */ function Foo() {}; var foo = new Foo();"
         + "!foo", "Foo");
 
-    testReportInstanceOf("(4 + 5)", "Number");
-    testReportInstanceOf("('a' + 'b')", "String");
-    testReportInstanceOf("('a' + 5)", "String");
-
-    // The following five are from "Wat — Destroy All Software Talks"
-    testReportInstanceOf("([] + [])", "String");
-    testReportInstanceOf("([] + {})", "String");
-    testReportInstanceOf("({} + [])", "String");
-    testReportInstanceOf("({c:1} + [])", "String");
-    testReportInstanceOf("({} + {})", "Number"); // NaN
-
     testReportInstanceOf("!''", "String");
     testReportInstanceOf("!4", "Number");
     testReportInstanceOf("!(new Boolean(true))", "Boolean");
@@ -182,29 +174,36 @@ public final class CheckSuspiciousCodeTest extends Es6CompilerTestCase {
         + "!this", "Foo;"
         + "}");
 
-    testSame("new String('') instanceof String");
-    testSame("new Number(4) instanceof Number");
-    testSame("var a = new Number(4); a instanceof Number");
-    testSame("new Boolean(true) instanceof Boolean");
-    testSame("new Object() instanceof Object");
-    testSame("Object.prototype instanceof Object");
-    testSame("Function instanceof Object");
-    testSame("func() instanceof String");
-    testSame("({}) instanceof Object");
-    testSame("/** @constructor */ function Foo() {"
+    testOk("new String('') instanceof String");
+    testOk("new Number(4) instanceof Number");
+    testOk("new Boolean(true) instanceof Boolean");
+    testOk("new Object() instanceof Object");
+    testOk("Object.prototype instanceof Object");
+    testOk("Function instanceof Object");
+    testOk("func() instanceof String");
+    testOk("({}) instanceof Object");
+    testOk("/** @constructor */ function Foo() {"
         + " var a = this instanceof Foo; }");
 
-    testSameEs6("(()=>42) instanceof Function");
-    testSameEs6("class Person{} Person instanceof Function");
-    testSameEs6(LINE_JOINER.join(
+    // TODO(apavlov): It would be nice to have this report, too.
+    testOk("(4 + 5) instanceof Number");
+
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    testOk("(()=>42) instanceof Function");
+    testOk("class Person{} Person instanceof Function");
+    testOk(LINE_JOINER.join(
         "class Person{}",
         "var peter = new Person();",
         "peter instanceof Person"));
-    testSameEs6("taggedTemplate`${tagged}Temp` instanceof Function");
+    testOk("taggedTemplate`${tagged}Temp` instanceof Function");
   }
 
   private void testReportInstanceOf(String left, String right) {
-    testWarning(left + " instanceof " + right,
+    testSame(left + " instanceof " + right,
         CheckSuspiciousCode.SUSPICIOUS_INSTANCEOF_LEFT_OPERAND);
   }
+
+  private void testOk(String js) {
+    test(js, (DiagnosticType) null);
+  }
 }
diff --git a/test/com/google/javascript/jscomp/CompilerTest.java b/test/com/google/javascript/jscomp/CompilerTest.java
index 0e8c21236..55ca662d7 100644
--- a/test/com/google/javascript/jscomp/CompilerTest.java
+++ b/test/com/google/javascript/jscomp/CompilerTest.java
@@ -156,7 +156,7 @@ public final class CompilerTest extends TestCase {
   }
 
   private String normalize(String path) {
-    return path.replace(File.separator, "/");
+    return path.replace("/", File.separator);
   }
 
   public void testInputSourceMaps() throws Exception {
diff --git a/test/com/google/javascript/jscomp/ConstParamCheckTest.java b/test/com/google/javascript/jscomp/ConstParamCheckTest.java
index 77945c26a..5f2edab3c 100644
--- a/test/com/google/javascript/jscomp/ConstParamCheckTest.java
+++ b/test/com/google/javascript/jscomp/ConstParamCheckTest.java
@@ -81,19 +81,6 @@ public final class ConstParamCheckTest extends CompilerTestCase {
         ConstParamCheck.CONST_NOT_STRING_LITERAL_ERROR);
   }
 
-  public void testNotStringLiteralArgumentAliasedAfterCollapse() {
-    testError(
-        CLOSURE_DEFS
-            + "var myFunction = function() {};"
-            + "var mkConst = goog$string$Const$from;"
-            + "mkConst(myFunction());",
-        ConstParamCheck.CONST_NOT_STRING_LITERAL_ERROR);
-  }
-
-  public void testNotStringLiteralArgumentOnCollapsedProperties() {
-    testError("goog$string$Const$from(null);", ConstParamCheck.CONST_NOT_STRING_LITERAL_ERROR);
-  }
-
   // Tests for string literal constant arguments.
 
   public void testStringLiteralConstantArgument() {
diff --git a/test/com/google/javascript/jscomp/Es6CompilerTestCase.java b/test/com/google/javascript/jscomp/Es6CompilerTestCase.java
index 1a8f9ccaa..f68698651 100644
--- a/test/com/google/javascript/jscomp/Es6CompilerTestCase.java
+++ b/test/com/google/javascript/jscomp/Es6CompilerTestCase.java
@@ -117,6 +117,18 @@ public abstract class Es6CompilerTestCase extends CompilerTestCase {
     setAcceptedLanguage(LanguageMode.ECMASCRIPT5);
   }
 
+  /**
+   * Verifies that the compiler pass's JS output is the same as its input, under
+   * just ES6. Usually this implies that the input contains ES6 features.
+   *
+   * @param js Input and output
+   * @param warning Expected warning, or null if no warning is expected
+   */
+  public void testSameEs6(String js, DiagnosticType warning) {
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(js, js, null, warning);
+  }
+
   /**
    * Verifies that the compiler pass's JS output is the same as its input
    * and (optionally) that an expected warning is issued, under both ES5 and ES6 modes.
diff --git a/test/com/google/javascript/jscomp/IntegrationTest.java b/test/com/google/javascript/jscomp/IntegrationTest.java
index 991dbb361..0db6411cc 100644
--- a/test/com/google/javascript/jscomp/IntegrationTest.java
+++ b/test/com/google/javascript/jscomp/IntegrationTest.java
@@ -112,54 +112,6 @@ public final class IntegrationTest extends IntegrationTestCase {
         "(function() {})('goog.CONSTANT', 1);");
   }
 
-  /**
-   * Tests that calls to goog.string.Const.from() with non-constant arguments
-   * are detected with and without collapsed properties.
-   */
-  public void testBug22684459() {
-    String source =
-        ""
-            + "var goog = {};"
-            + "goog.string = {};"
-            + "goog.string.Const = {};"
-            + "goog.string.Const.from = function(x) {};"
-            + "var x = window.document.location;"
-            + "goog.string.Const.from(x);";
-
-    // Without collapsed properties.
-    CompilerOptions options = createCompilerOptions();
-    test(options, source, ConstParamCheck.CONST_NOT_ASSIGNED_STRING_LITERAL_ERROR);
-
-    // With collapsed properties.
-    options.setCollapseProperties(true);
-    test(options, source, ConstParamCheck.CONST_NOT_ASSIGNED_STRING_LITERAL_ERROR);
-  }
-
-  /**
-   * Tests that calls to goog.string.Const.from() with non-constant arguments
-   * are detected with and without collapsed properties, even when
-   * goog.string.Const.from has been aliased.
-   */
-  public void testBug22684459_aliased() {
-    String source =
-        ""
-            + "var goog = {};"
-            + "goog.string = {};"
-            + "goog.string.Const = {};"
-            + "goog.string.Const.from = function(x) {};"
-            + "var mkConst = goog.string.Const.from;"
-            + "var x = window.document.location;"
-            + "mkConst(x);";
-
-    // Without collapsed properties.
-    CompilerOptions options = createCompilerOptions();
-    test(options, source, ConstParamCheck.CONST_NOT_ASSIGNED_STRING_LITERAL_ERROR);
-
-    // With collapsed properties.
-    options.setCollapseProperties(true);
-    test(options, source, ConstParamCheck.CONST_NOT_ASSIGNED_STRING_LITERAL_ERROR);
-  }
-
   public void testBug2410122() {
     CompilerOptions options = createCompilerOptions();
     options.setGenerateExports(true);
diff --git a/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java b/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java
index 6048bea5c..9002a4f32 100644
--- a/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java
+++ b/test/com/google/javascript/jscomp/NewTypeInferenceES5OrLowerTest.java
@@ -9686,13 +9686,13 @@ public final class NewTypeInferenceES5OrLowerTest extends NewTypeInferenceTestBa
         "function g() { s - 5; }"),
         NewTypeInference.INVALID_OPERAND_TYPE);
 
-    typeCheck(Joiner.on('\n').join(
-        "var /** string */ x;",
-        "/** @const */",
-        "var s = x;",
-        "function g() { s - 5; }"),
-        NewTypeInference.MISTYPED_ASSIGN_RHS,
-        NewTypeInference.INVALID_OPERAND_TYPE);
+    // TODO(dimvar): must fix externs initialization
+    // typeCheck(Joiner.on('\n').join(
+    //     "var /** string */ x;",
+    //     "/** @const */",
+    //     "var s = x;",
+    //     "function g() { s - 5; }"),
+    //     NewTypeInference.INVALID_OPERAND_TYPE);
 
     typeCheck(Joiner.on('\n').join(
         "/** @constructor */",
@@ -9861,10 +9861,6 @@ public final class NewTypeInferenceES5OrLowerTest extends NewTypeInferenceTestBa
         "/** @const */",
         "var x = whatever.prop;"),
         GlobalTypeInfo.COULD_NOT_INFER_CONST_TYPE);
-
-    typeCheckCustomExterns(
-        DEFAULT_EXTERNS + "var NOT_A_CONST_DONT_WARN;",
-        "");
   }
 
   public void testSuppressions() {
diff --git a/test/com/google/javascript/jscomp/PolymerPassTest.java b/test/com/google/javascript/jscomp/PolymerPassTest.java
index b9c562903..2c68a9cc3 100644
--- a/test/com/google/javascript/jscomp/PolymerPassTest.java
+++ b/test/com/google/javascript/jscomp/PolymerPassTest.java
@@ -24,11 +24,13 @@ import static com.google.javascript.jscomp.PolymerPass.POLYMER_UNEXPECTED_PARAMS
 import static com.google.javascript.jscomp.PolymerPass.POLYMER_UNQUALIFIED_BEHAVIOR;
 import static com.google.javascript.jscomp.TypeValidator.TYPE_MISMATCH_WARNING;
 
+import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
+
 /**
  * Unit tests for PolymerPass
  * @author jlklein@google.com (Jeremy Klein)
  */
-public class PolymerPassTest extends Es6CompilerTestCase {
+public class PolymerPassTest extends CompilerTestCase {
   private static final String EXTERNS =
       LINE_JOINER.join(
           "/** @constructor */",
@@ -152,6 +154,7 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   @Override
   protected void setUp() throws Exception {
     super.setUp();
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT5);
     allowExternsChanges(true);
     enableTypeCheck(CheckLevel.WARNING);
     runTypeCheckAfterProcessing = true;
@@ -179,8 +182,9 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testLetTarget() {
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
     disableTypeCheck();
-    testErrorEs6(
+    testError(
         LINE_JOINER.join(
             "let X = Polymer({",
             "  is: 'x-element',",
@@ -188,8 +192,9 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testConstTarget() {
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
     disableTypeCheck();
-    testErrorEs6(
+    testError(
         LINE_JOINER.join(
             "const X = Polymer({",
             "  is: 'x-element',",
@@ -232,8 +237,9 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testComputedPropName() {
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
     disableTypeCheck(); // TypeCheck cannot grab a name from a complicated computedPropName
-    testEs6("var X = Polymer({is:'x-element', [name + (() => 42)]: function() {return 42;}});",
+    test("var X = Polymer({is:'x-element', [name + (() => 42)]: function() {return 42;}});",
         LINE_JOINER.join(
             "/** @constructor @extends {PolymerElement} @implements {PolymerXInterface} */",
             "var X = function() {}",
@@ -359,7 +365,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testShorthandConstructorExtraction() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "var X = Polymer({",
             "  is: 'x-element',",
@@ -597,7 +604,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testPropertiesDefaultValueShortHandFunction() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "/** @constructor */",
             "var User = function() {};",
@@ -678,7 +686,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testShorthandFunctionDefinition() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "var ES6Test = Polymer({",
             "  is: 'x-element',",
@@ -703,7 +712,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testArrowFunctionDefinition() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "var ES6Test = Polymer({",
             "  is: 'x-element',",
@@ -724,7 +734,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testShorthandLifecycleCallbacks() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "var ES6Test = Polymer({",
             "  is: 'x-element',",
@@ -750,7 +761,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testShorthandFunctionDefinitionWithReturn() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "var ESTest = Polymer({",
             "  is: 'x-element',",
@@ -879,7 +891,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testDollarSignPropsInShorthandFunctionConvertedToBrackets() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "/** @constructor */",
             "var SomeType = function() {};",
@@ -1145,7 +1158,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testBehaviorShorthandFunctionOverriddenByElement() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "/** @polymerBehavior */",
             "var FunBehavior = {",
@@ -1572,7 +1586,8 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testBehaviorShorthandFunctionOverriding() {
-    testEs6(
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    test(
         LINE_JOINER.join(
             "/** @polymerBehavior */",
             "var FunBehavior = {",
@@ -1939,8 +1954,9 @@ public class PolymerPassTest extends Es6CompilerTestCase {
     testWarning("var x = Polymer('foo-bar', {});", POLYMER_DESCRIPTOR_NOT_VALID);
     testError("var x = Polymer({},'blah');", POLYMER_UNEXPECTED_PARAMS);
     testError("var x = Polymer({});", POLYMER_MISSING_IS);
-    testErrorEs6("var x = Polymer({is});", POLYMER_MISSING_IS);
-    testErrorEs6("var x = Polymer({is: 'x-element', shortHand,});",
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
+    testError("var x = Polymer({is});", POLYMER_MISSING_IS);
+    testError("var x = Polymer({is: 'x-element', shortHand,});",
         POLYMER_SHORTHAND_NOT_SUPPORTED);
   }
 
@@ -2077,8 +2093,9 @@ public class PolymerPassTest extends Es6CompilerTestCase {
   }
 
   public void testES6FeaturesInFunctionBody() {
+    setAcceptedLanguage(LanguageMode.ECMASCRIPT6);
     disableTypeCheck();
-    testEs6(
+    test(
         LINE_JOINER.join(
             "var X = Polymer({",
             "  is: 'x-element',",
diff --git a/test/com/google/javascript/jscomp/ProcessClosurePrimitivesTest.java b/test/com/google/javascript/jscomp/ProcessClosurePrimitivesTest.java
index 0b1f4eb33..a1c790dce 100644
--- a/test/com/google/javascript/jscomp/ProcessClosurePrimitivesTest.java
+++ b/test/com/google/javascript/jscomp/ProcessClosurePrimitivesTest.java
@@ -170,23 +170,12 @@ public final class ProcessClosurePrimitivesTest extends Es6CompilerTestCase {
          "var foo = {a: 0};");
     test("goog.provide('foo'); foo = function(){};",
          "var foo = function(){};");
-    testEs6("goog.provide('foo'); foo = ()=>{};",
-            "var foo = ()=>{};");
-
     test("goog.provide('foo'); var foo = 0;",
          "var foo = 0;");
-    testEs6("goog.provide('foo'); let foo = 0;",
-            "let foo = 0;");
-    testEs6("goog.provide('foo'); const foo = 0;",
-            "const foo = 0;");
-
     test("goog.provide('foo'); var foo = {a: 0};",
          "var foo = {a: 0};");
     test("goog.provide('foo'); var foo = function(){};",
          "var foo = function(){};");
-    testEs6("goog.provide('foo'); var foo = ()=>{};",
-            "var foo = ()=>{};");
-
     test("goog.provide('foo.bar.Baz'); foo.bar.Baz=function(){};",
          "var foo={}; foo.bar={}; foo.bar.Baz=function(){};");
     test("goog.provide('foo.bar.moo'); foo.bar.moo={E:1,S:2};",
@@ -213,15 +202,11 @@ public final class ProcessClosurePrimitivesTest extends Es6CompilerTestCase {
   public void testRemovalMultipleAssignment2() {
     test("goog.provide('foo'); var foo = 0; foo = 1",
          "var foo = 0; foo = 1;");
-    testEs6("goog.provide('foo'); let foo = 0; let foo = 1",
-        "let foo = 0; let foo = 1;");
   }
 
   public void testRemovalMultipleAssignment3() {
     test("goog.provide('foo'); foo = 0; var foo = 1",
          "foo = 0; var foo = 1;");
-    testEs6("goog.provide('foo'); foo = 0; let foo = 1",
-        "foo = 0; let foo = 1;");
   }
 
   public void testRemovalMultipleAssignment4() {
@@ -239,11 +224,6 @@ public final class ProcessClosurePrimitivesTest extends Es6CompilerTestCase {
          "var foo = {}; function f(){var foo = 0}");
   }
 
-  public void testNoRemovalFunction3() {
-    testEs6("goog.provide('foo'); function f(foo = 0){}",
-         "var foo = {}; function f(foo = 0){}");
-  }
-
   public void testRemovalMultipleAssignmentInIf1() {
     test("goog.provide('foo'); if (true) { var foo = 0 } else { foo = 1 }",
          "if (true) { var foo = 0 } else { foo = 1 }");
diff --git a/test/com/google/javascript/jscomp/ProcessCommonJSModulesTest.java b/test/com/google/javascript/jscomp/ProcessCommonJSModulesTest.java
index 41adea1ae..c194035bb 100644
--- a/test/com/google/javascript/jscomp/ProcessCommonJSModulesTest.java
+++ b/test/com/google/javascript/jscomp/ProcessCommonJSModulesTest.java
@@ -75,15 +75,13 @@ public final class ProcessCommonJSModulesTest extends CompilerTestCase {
     ProcessEs6ModulesTest.testModules(
         this,
         ImmutableList.of(
-            SourceFile.fromCode(Compiler.joinPathParts("mod", "name.js"), ""),
+            SourceFile.fromCode("mod/name.js", ""),
             SourceFile.fromCode(
-                Compiler.joinPathParts("test", "sub.js"),
-                "var name = require('mod/name');"
-                + "(function() { name(); })();")),
-                "goog.provide('module$test$sub');"
-                + "goog.require('module$mod$name');"
-                + "var name$$module$test$sub = module$mod$name;"
-                + "(function() { name$$module$test$sub(); })();");
+                "test/sub.js", "var name = require('mod/name');" + "(function() { name(); })();")),
+        "goog.provide('module$test$sub');"
+            + "goog.require('module$mod$name');"
+            + "var name$$module$test$sub = module$mod$name;"
+            + "(function() { name$$module$test$sub(); })();");
   }
 
   public void testExports() {
@@ -161,8 +159,8 @@ public final class ProcessCommonJSModulesTest extends CompilerTestCase {
     ProcessEs6ModulesTest.testModules(
         this,
         ImmutableList.of(
-            SourceFile.fromCode(Compiler.joinPathParts("foo", "name.js"), ""),
-            SourceFile.fromCode(Compiler.joinPathParts("foo", "bar.js"), "var name = require('./name');")),
+            SourceFile.fromCode("foo/name.js", ""),
+            SourceFile.fromCode("foo/bar.js", "var name = require('./name');")),
         "goog.provide('module$foo$bar');"
             + "goog.require('module$foo$name');"
             + "var name$$module$foo$bar = module$foo$name;");
diff --git a/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java b/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java
index 0af03665e..3ebf07d9a 100644
--- a/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java
+++ b/test/com/google/javascript/jscomp/ProcessEs6ModulesTest.java
@@ -124,8 +124,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "var a$$module$testcode = 1, b$$module$testcode = 2;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.a = a$$module$testcode;",
             "module$testcode.b = b$$module$testcode;"));
 
@@ -134,8 +132,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "var a$$module$testcode; var b$$module$testcode;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.a = a$$module$testcode;",
             "module$testcode.b = b$$module$testcode;"));
 
@@ -144,8 +140,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "function f$$module$testcode() {}",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.f = f$$module$testcode;"));
 
     testModules(
@@ -154,8 +148,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "function f$$module$testcode() {}",
             "function g$$module$testcode() { f$$module$testcode(); }",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.f = f$$module$testcode;"));
 
     testModules(
@@ -164,8 +156,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "function MyClass$$module$testcode() {}",
             "MyClass$$module$testcode.prototype.foo = function() {};",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.MyClass = MyClass$$module$testcode;"));
 
     testModules(
@@ -174,8 +164,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "var f$$module$testcode = 1;",
             "var b$$module$testcode = 2;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.foo = f$$module$testcode;",
             "module$testcode.bar = b$$module$testcode;"));
   }
@@ -187,8 +175,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "/** @constructor */",
             "function F$$module$testcode() { return ''; }",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.F = F$$module$testcode"));
 
     testModules(
@@ -197,8 +183,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "/** @return {string} */",
             "function f$$module$testcode() { return ''; }",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.f = f$$module$testcode"));
 
     testModules(
@@ -207,8 +191,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "/** @return {string} */",
             "var f$$module$testcode = function() { return ''; }",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.f = f$$module$testcode"));
 
     testModules(
@@ -217,8 +199,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "/** @type {number} */",
             "var x$$module$testcode = 3;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.x = x$$module$testcode"));
   }
 
@@ -229,8 +209,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "goog.require('module$other');",
             "use(module$other.name);",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.name = module$other.name;"));
   }
 
@@ -240,8 +218,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "goog.require('module$other');",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.name = module$other.name;"));
 
     testModules(
@@ -249,8 +225,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "goog.require('module$other');",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.a = module$other.a;",
             "module$testcode.c = module$other.b;",
             "module$testcode.d = module$other.d;"));
@@ -262,8 +236,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "var $jscompDefaultExport$$module$testcode = 'someString';",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.default = $jscompDefaultExport$$module$testcode;"));
 
     testModules(
@@ -272,8 +244,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "var x$$module$testcode = 5;",
             "var $jscompDefaultExport$$module$testcode = x$$module$testcode;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.default = $jscompDefaultExport$$module$testcode;"));
 
     testModules(
@@ -282,8 +252,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "function f$$module$testcode() {}",
             "var x$$module$testcode = f$$module$testcode();",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.default = f$$module$testcode;"));
 
     testModules(
@@ -292,8 +260,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "class Foo$$module$testcode {}",
             "var x$$module$testcode = new Foo$$module$testcode;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.default = Foo$$module$testcode;"));
   }
 
@@ -303,8 +269,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "var $jscompDefaultExport$$module$testcode = class {};",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.default = $jscompDefaultExport$$module$testcode;"));
 
     testModules(
@@ -312,8 +276,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
         LINE_JOINER.join(
             "goog.provide('module$testcode');",
             "var $jscompDefaultExport$$module$testcode = function() {}",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.default = $jscompDefaultExport$$module$testcode;"));
   }
 
@@ -360,8 +322,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "  /** @param {Parent$$module$other} parent */",
             "  useParent(parent) {}",
             "}",
-            "/** @const */",
-            "var module$testcode = {};",
             "/** @const */ module$testcode.Child = Child$$module$testcode;"));
   }
 
@@ -375,8 +335,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "  /** @param {Child$$module$testcode} child */",
             "  useChild(child) {}",
             "}",
-            "/** @const */",
-            "var module$testcode = {};",
             "/** @const */ module$testcode.Child = Child$$module$testcode;"));
 
     testModules(
@@ -391,8 +349,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "  /** @param {Child$$module$testcode.Foo.Bar.Baz} baz */",
             "  useBaz(baz) {}",
             "}",
-            "/** @const */",
-            "var module$testcode = {};",
             "/** @const */ module$testcode.Child = Child$$module$testcode;"));
   }
 
@@ -406,8 +362,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "  /** @param {module$other.Baz} baz */",
             "  useBaz(baz) {}",
             "}",
-            "/** @const */",
-            "var module$testcode = {};",
             "/** @const */ module$testcode.Foo = Foo$$module$testcode;"));
   }
 
@@ -420,8 +374,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.require('module$other');",
             "/** @typedef {string|!Object} */",
             "var UnionType$$module$testcode;",
-            "/** @const */",
-            "var module$testcode = {};",
             "/** @typedef {UnionType$$module$testcode} */",
             "module$testcode.UnionType;"));
   }
@@ -463,8 +415,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "goog.require('foo.bar');",
             "var x$$module$testcode;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.x = x$$module$testcode"));
 
     testModules(
@@ -473,8 +423,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.provide('module$testcode');",
             "var x$$module$testcode;",
             "goog.require('foo.bar');",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.x = x$$module$testcode"));
 
     testModules(
@@ -494,8 +442,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "goog.require('foo.bar');",
             "var bar$$module$testcode = foo.bar;",
             "var x$$module$testcode;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.x = x$$module$testcode"));
 
     testModules(
@@ -505,8 +451,6 @@ public final class ProcessEs6ModulesTest extends CompilerTestCase {
             "var x$$module$testcode;",
             "goog.require('foo.bar');",
             "var bar$$module$testcode = foo.bar;",
-            "/** @const */",
-            "var module$testcode = {};",
             "module$testcode.x = x$$module$testcode"));
 
     testModules(
diff --git a/test/com/google/javascript/jscomp/SourceMapTest.java b/test/com/google/javascript/jscomp/SourceMapTest.java
index 3970e56ac..2ab7a5183 100644
--- a/test/com/google/javascript/jscomp/SourceMapTest.java
+++ b/test/com/google/javascript/jscomp/SourceMapTest.java
@@ -40,8 +40,7 @@ public final class SourceMapTest extends SourceMapTestCase {
   public void testPrefixReplacement1() throws IOException {
     // mapping can be used to remove a prefix
     mappings = ImmutableList.of(new SourceMap.LocationMapping("pre/", ""));
-    checkSourceMap2("alert(1);", Compiler.joinPathParts("pre", "file1"), "alert(2);",
-        Compiler.joinPathParts("pre", "file2") , "{\n" +
+    checkSourceMap2("alert(1);", "pre/file1", "alert(2);", "pre/file2" , "{\n" +
         "\"version\":3,\n" +
         "\"file\":\"testcode\",\n" +
         "\"lineCount\":1,\n" +
@@ -53,10 +52,8 @@ public final class SourceMapTest extends SourceMapTestCase {
 
   public void testPrefixReplacement2() throws IOException {
     // mapping can be used to replace a prefix
-    mappings = ImmutableList.of(
-        new SourceMap.LocationMapping("pre/file", "src"));
-    checkSourceMap2("alert(1);", Compiler.joinPathParts("pre", "file1"), "alert(2);",
-        "pre/file2" , "{\n" +
+    mappings = ImmutableList.of(new SourceMap.LocationMapping("pre/file", "src"));
+    checkSourceMap2("alert(1);", "pre/file1", "alert(2);", "pre/file2" , "{\n" +
         "\"version\":3,\n" +
         "\"file\":\"testcode\",\n" +
         "\"lineCount\":1,\n" +
diff --git a/test/com/google/javascript/jscomp/StrictModeCheckTest.java b/test/com/google/javascript/jscomp/StrictModeCheckTest.java
index 4905333c2..19483ccd3 100644
--- a/test/com/google/javascript/jscomp/StrictModeCheckTest.java
+++ b/test/com/google/javascript/jscomp/StrictModeCheckTest.java
@@ -226,9 +226,9 @@ public final class StrictModeCheckTest extends Es6CompilerTestCase {
         "};");
 
     disableTypeCheck();
-    testWarningEs6("var x = {a: 2, a(){}}", StrictModeCheck.DUPLICATE_OBJECT_KEY);
-    testWarningEs6("var x = {a, a(){}}", StrictModeCheck.DUPLICATE_OBJECT_KEY);
-    testWarningEs6("var x = {a(){}, a(){}}", StrictModeCheck.DUPLICATE_OBJECT_KEY);
+    testSameEs6("var x = {a: 2, a(){}}", StrictModeCheck.DUPLICATE_OBJECT_KEY);
+    testSameEs6("var x = {a, a(){}}", StrictModeCheck.DUPLICATE_OBJECT_KEY);
+    testSameEs6("var x = {a(){}, a(){}}", StrictModeCheck.DUPLICATE_OBJECT_KEY);
   }
 
   public void testFunctionDecl() {
@@ -291,7 +291,7 @@ public final class StrictModeCheckTest extends Es6CompilerTestCase {
         "}"));
 
     // Duplicate obj literal key in classes
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {",
         "    var obj = {a : 1, a : 2}",
@@ -299,7 +299,7 @@ public final class StrictModeCheckTest extends Es6CompilerTestCase {
         "}"), StrictModeCheck.DUPLICATE_OBJECT_KEY);
 
     // Unknown variable test
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  constructor() {this.a = 1;}",
         "  method() {this.a = b}",
@@ -313,7 +313,7 @@ public final class StrictModeCheckTest extends Es6CompilerTestCase {
         "}"));
 
     // Use of with test
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  constructor() {this.x = 1;}",
         "  method() {",
@@ -322,37 +322,37 @@ public final class StrictModeCheckTest extends Es6CompilerTestCase {
         "}"), StrictModeCheck.USE_OF_WITH);
 
     // Eval errors test
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method(eval) {}",
         "}"), StrictModeCheck.EVAL_DECLARATION);
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {var eval = 1;}",
         "}"), StrictModeCheck.EVAL_DECLARATION);
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {eval = 1}",
         "}"), StrictModeCheck.EVAL_ASSIGNMENT);
 
     // Use of 'arguments'
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method(arguments) {}",
         "}"), StrictModeCheck.ARGUMENTS_DECLARATION);
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {var arguments = 1;}",
         "}"), StrictModeCheck.ARGUMENTS_DECLARATION);
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {arguments = 1}",
         "}"), StrictModeCheck.ARGUMENTS_ASSIGNMENT);
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {arguments.callee}",
         "}"), StrictModeCheck.ARGUMENTS_CALLEE_FORBIDDEN);
-    testWarningEs6(LINE_JOINER.join(
+    testSameEs6(LINE_JOINER.join(
         "class A {",
         "  method() {arguments.caller}",
         "}"), StrictModeCheck.ARGUMENTS_CALLER_FORBIDDEN);