Skip to content

Commit

Permalink
Don't link exported const vars to module definition
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158087947
  • Loading branch information
salguarnieri authored and brad4d committed Jun 6, 2017
1 parent ec7899c commit 8b406d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/com/google/javascript/jscomp/ClosureRewriteModule.java
Expand Up @@ -1629,11 +1629,11 @@ private void replaceStringNodeLocationForExportedTopLevelVariable(
// ASSIGN always has two children. // ASSIGN always has two children.
Node getProp = assign.getFirstChild(); Node getProp = assign.getFirstChild();
if (getProp != null && getProp.isGetProp()) { if (getProp != null && getProp.isGetProp()) {
// GETPROP always has two children. // GETPROP always has two children: a name node and a string node. They should both take
Node stringNode = getProp.getLastChild(); // on the source range of the original variable.
if (stringNode != null && stringNode.isString()) { for (Node child : getProp.children()) {
stringNode.setSourceEncodedPosition(sourcePosition); child.setSourceEncodedPosition(sourcePosition);
stringNode.setLength(length); child.setLength(length);
} }
} }
} }
Expand Down

0 comments on commit 8b406d6

Please sign in to comment.