Skip to content

Commit

Permalink
fixed files form Closure #9
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 88ebf93 commit 86faa15
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static String toModuleName(String requiredFilename,
private String normalizeSourceName(String filename) {
// The DOS command shell will normalize "/" to "\", so we have to
// wrestle it back.
filename = filename.replace("\\", "/");

if (filename.indexOf(filenamePrefix) == 0) {
filename = filename.substring(filenamePrefix.length());
Expand Down Expand Up @@ -180,7 +181,7 @@ private void visitScript(NodeTraversal t, Node script) {
Preconditions.checkArgument(scriptNodeCount == 1,
"ProcessCommonJSModules supports only one invocation per " +
"CompilerInput / script node");
String moduleName = guessCJSModuleName(normalizeSourceName(script.getSourceFileName()));
String moduleName = guessCJSModuleName(script.getSourceFileName());
script.addChildToFront(IR.var(IR.name(moduleName), IR.objectlit())
.copyInformationFromForTree(script));
if (reportDependencies) {
Expand Down

0 comments on commit 86faa15

Please sign in to comment.