Skip to content

Commit

Permalink
Ignore some nodes that result from goog.provide() rewrite and mess up…
Browse files Browse the repository at this point in the history
… index.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216549709
  • Loading branch information
nbeloglazov authored and brad4d committed Oct 11, 2018
1 parent 794012c commit 7ecd6e7
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/com/google/javascript/jscomp/ProcessClosurePrimitives.java
Expand Up @@ -1552,19 +1552,24 @@ private Node makeVarDeclNode(Node value) {
* (e.g. <code>foo.bar = {};</code>).
*/
private Node makeAssignmentExprNode(Node value) {
Node decl = IR.exprResult(
IR.assign(
NodeUtil.newQName(
compiler, namespace,
firstNode /* real source info will be filled in below */,
namespace),
value));
Node lhs =
NodeUtil.newQName(
compiler,
namespace,
firstNode /* real source info will be filled in below */,
namespace);
Node decl = IR.exprResult(IR.assign(lhs, value));
decl.putBooleanProp(Node.IS_NAMESPACE, true);
if (candidateDefinition == null) {
decl.getFirstChild().setJSDocInfo(NodeUtil.createConstantJsDoc());
}
checkState(isNamespacePlaceholder(decl));
setSourceInfo(decl);
// This function introduces artifical nodes and we don't need them for indexing.
// Marking all but the last one as non-indexable. So if this function adds:
// foo.bar.baz = {};
// then we mark foo and bar as non-indexable.
lhs.getFirstChild().makeNonIndexableRecursive();
return decl;
}

Expand Down

0 comments on commit 7ecd6e7

Please sign in to comment.