Skip to content

Commit

Permalink
Renaming files from "ProcessEs6Modules" to "Es6RewriteModules" to imp…
Browse files Browse the repository at this point in the history
…rove file organization/readability

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157524318
  • Loading branch information
hjkaria authored and blickly committed May 30, 2017
1 parent 2df399f commit 311397b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/Compiler.java
Expand Up @@ -2086,7 +2086,7 @@ void processEs6Modules(List<CompilerInput> inputsToProcess, boolean forceRewrite
if (root == null) {
continue;
}
new ProcessEs6Modules(this).processFile(root, forceRewrite);
new Es6RewriteModules(this).processFile(root, forceRewrite);
}

setFeatureSet(featureSet.withoutModules());
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/CompilerInput.java
Expand Up @@ -389,7 +389,7 @@ private static <T> Set<T> concat(Iterable<T> first, Iterable<T> second) {

ModulePath getPath() {
if (modulePath == null) {
// Note: this method will not be called until ProcessEs6Modules
// Note: this method will not be called until Es6RewriteModules
// (and similar), after Compiler.moduleLoader is already set.
this.modulePath = compiler.getModuleLoader().resolve(getName());
}
Expand Down
Expand Up @@ -40,7 +40,7 @@
*
* @author moz@google.com (Michael Zhou)
*/
public final class ProcessEs6Modules extends AbstractPostOrderCallback {
public final class Es6RewriteModules extends AbstractPostOrderCallback {
private static final String DEFAULT_EXPORT_NAME = "$jscompDefaultExport";

static final DiagnosticType LHS_OF_GOOG_REQUIRE_MUST_BE_CONST =
Expand Down Expand Up @@ -82,10 +82,10 @@ public final class ProcessEs6Modules extends AbstractPostOrderCallback {
private Node googRequireInsertSpot;

/**
* Creates a new ProcessEs6Modules instance which can be used to rewrite
* Creates a new Es6RewriteModules instance which can be used to rewrite
* ES6 modules to a concatenable form.
*/
public ProcessEs6Modules(Compiler compiler) {
public Es6RewriteModules(Compiler compiler) {
this.compiler = compiler;
}

Expand Down Expand Up @@ -359,7 +359,7 @@ private void visitScript(NodeTraversal t, Node script) {
ClosureRewriteModule.checkAndSetStrictModeDirective(t, script);

Preconditions.checkArgument(scriptNodeCount == 1,
"ProcessEs6Modules supports only one invocation per "
"Es6RewriteModules supports only one invocation per "
+ "CompilerInput / script node");

// rewriteRequires is here (rather than being part of the main visit()
Expand Down
Expand Up @@ -16,17 +16,17 @@

package com.google.javascript.jscomp;

import static com.google.javascript.jscomp.ProcessEs6Modules.LHS_OF_GOOG_REQUIRE_MUST_BE_CONST;
import static com.google.javascript.jscomp.Es6RewriteModules.LHS_OF_GOOG_REQUIRE_MUST_BE_CONST;

import com.google.common.collect.ImmutableList;
import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
import com.google.javascript.rhino.Node;

/**
* Unit tests for {@link ProcessEs6Modules}
* Unit tests for {@link Es6RewriteModules}
*/

public final class ProcessEs6ModulesTest extends CompilerTestCase {
public final class Es6RewriteModulesTest extends CompilerTestCase {
private ImmutableList<String> moduleRoots = null;

@Override
Expand Down Expand Up @@ -624,7 +624,7 @@ public void testNamespaceImports() {
"var foo$$module$testcode = new other.Foo();"));

testModules("import * as Foo from 'goog:other.Foo';",
ProcessEs6Modules.NAMESPACE_IMPORT_CANNOT_USE_STAR);
Es6RewriteModules.NAMESPACE_IMPORT_CANNOT_USE_STAR);
}

public void testObjectDestructuringAndObjLitShorthand() {
Expand Down
Expand Up @@ -56,7 +56,7 @@ protected int getNumRepetitions() {
}

void testModules(String input, String expected) {
ProcessEs6ModulesTest.testModules(this, input, expected);
Es6RewriteModulesTest.testModules(this, input, expected);
}

public void testWithoutExports() {
Expand Down

0 comments on commit 311397b

Please sign in to comment.