From 7580f657e1d513efb06eb1ff9821e872a8b743c6 Mon Sep 17 00:00:00 2001 From: bradfordcsmith Date: Wed, 10 May 2017 08:14:20 -0700 Subject: [PATCH] Factor ReferenceCollection out of ReferenceCollectingCallback. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=155629421 --- .../javascript/jscomp/AbstractCompiler.java | 1 - .../jscomp/AggressiveInlineAliases.java | 1 - .../google/javascript/jscomp/Compiler.java | 1 - .../jscomp/CrossModuleCodeMotion.java | 1 - .../google/javascript/jscomp/Denormalize.java | 1 - .../jscomp/GlobalVarReferenceMap.java | 1 - .../jscomp/HoistVarsOutOfBlocks.java | 1 - .../google/javascript/jscomp/InferConsts.java | 1 - .../jscomp/InlineObjectLiterals.java | 1 - .../javascript/jscomp/InlineVariables.java | 1 - .../jscomp/ReferenceCollectingCallback.java | 212 ----------------- .../jscomp/ReferenceCollection.java | 218 ++++++++++++++++++ .../jscomp/SideEffectsAnalysis.java | 1 - .../jscomp/VariableReferenceCheck.java | 1 - .../jscomp/VariableVisibilityAnalysis.java | 1 - .../jscomp/GlobalVarReferenceMapTest.java | 1 - .../ReferenceCollectingCallbackTest.java | 1 - 17 files changed, 218 insertions(+), 227 deletions(-) create mode 100644 src/com/google/javascript/jscomp/ReferenceCollection.java diff --git a/src/com/google/javascript/jscomp/AbstractCompiler.java b/src/com/google/javascript/jscomp/AbstractCompiler.java index b4287039b68..98e445ace07 100644 --- a/src/com/google/javascript/jscomp/AbstractCompiler.java +++ b/src/com/google/javascript/jscomp/AbstractCompiler.java @@ -20,7 +20,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.deps.ModuleLoader; import com.google.javascript.jscomp.parsing.Config; import com.google.javascript.jscomp.parsing.parser.trees.Comment; diff --git a/src/com/google/javascript/jscomp/AggressiveInlineAliases.java b/src/com/google/javascript/jscomp/AggressiveInlineAliases.java index 97395224896..0cff6c3baa0 100644 --- a/src/com/google/javascript/jscomp/AggressiveInlineAliases.java +++ b/src/com/google/javascript/jscomp/AggressiveInlineAliases.java @@ -22,7 +22,6 @@ import com.google.javascript.jscomp.GlobalNamespace.Name; import com.google.javascript.jscomp.GlobalNamespace.Ref; import com.google.javascript.jscomp.GlobalNamespace.Ref.Type; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; import java.util.ArrayDeque; diff --git a/src/com/google/javascript/jscomp/Compiler.java b/src/com/google/javascript/jscomp/Compiler.java index 303e7979a85..a68b065a6ae 100644 --- a/src/com/google/javascript/jscomp/Compiler.java +++ b/src/com/google/javascript/jscomp/Compiler.java @@ -31,7 +31,6 @@ import com.google.javascript.jscomp.CompilerOptions.DevMode; import com.google.javascript.jscomp.CoverageInstrumentationPass.CoverageReach; import com.google.javascript.jscomp.CoverageInstrumentationPass.InstrumentOption; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.WarningsGuard.DiagnosticGroupState; import com.google.javascript.jscomp.deps.JsFileParser; import com.google.javascript.jscomp.deps.ModuleLoader; diff --git a/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java b/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java index 1bbd7fbe42d..839b9cc7ff9 100644 --- a/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java +++ b/src/com/google/javascript/jscomp/CrossModuleCodeMotion.java @@ -20,7 +20,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.javascript.jscomp.CodingConvention.SubclassRelationship; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; diff --git a/src/com/google/javascript/jscomp/Denormalize.java b/src/com/google/javascript/jscomp/Denormalize.java index d1e8700f250..7c8e0b187bd 100644 --- a/src/com/google/javascript/jscomp/Denormalize.java +++ b/src/com/google/javascript/jscomp/Denormalize.java @@ -20,7 +20,6 @@ import com.google.javascript.jscomp.NodeTraversal.Callback; import com.google.javascript.jscomp.ReferenceCollectingCallback.Behavior; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; diff --git a/src/com/google/javascript/jscomp/GlobalVarReferenceMap.java b/src/com/google/javascript/jscomp/GlobalVarReferenceMap.java index e392ef81d6c..83ec6d57b68 100644 --- a/src/com/google/javascript/jscomp/GlobalVarReferenceMap.java +++ b/src/com/google/javascript/jscomp/GlobalVarReferenceMap.java @@ -17,7 +17,6 @@ package com.google.javascript.jscomp; import com.google.common.base.Preconditions; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.InputId; import com.google.javascript.rhino.Node; diff --git a/src/com/google/javascript/jscomp/HoistVarsOutOfBlocks.java b/src/com/google/javascript/jscomp/HoistVarsOutOfBlocks.java index 5f6a403994a..e9d3697588b 100644 --- a/src/com/google/javascript/jscomp/HoistVarsOutOfBlocks.java +++ b/src/com/google/javascript/jscomp/HoistVarsOutOfBlocks.java @@ -16,7 +16,6 @@ package com.google.javascript.jscomp; import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; diff --git a/src/com/google/javascript/jscomp/InferConsts.java b/src/com/google/javascript/jscomp/InferConsts.java index 4bd4080a9f1..c40b427de22 100644 --- a/src/com/google/javascript/jscomp/InferConsts.java +++ b/src/com/google/javascript/jscomp/InferConsts.java @@ -16,7 +16,6 @@ package com.google.javascript.jscomp; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.rhino.JSDocInfo; import com.google.javascript.rhino.Node; diff --git a/src/com/google/javascript/jscomp/InlineObjectLiterals.java b/src/com/google/javascript/jscomp/InlineObjectLiterals.java index 75d9e8f27a7..b99d1ca70fa 100644 --- a/src/com/google/javascript/jscomp/InlineObjectLiterals.java +++ b/src/com/google/javascript/jscomp/InlineObjectLiterals.java @@ -21,7 +21,6 @@ import com.google.common.base.Supplier; import com.google.common.collect.Lists; import com.google.javascript.jscomp.ReferenceCollectingCallback.Behavior; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; diff --git a/src/com/google/javascript/jscomp/InlineVariables.java b/src/com/google/javascript/jscomp/InlineVariables.java index 391020405c5..d40768ada82 100644 --- a/src/com/google/javascript/jscomp/InlineVariables.java +++ b/src/com/google/javascript/jscomp/InlineVariables.java @@ -21,7 +21,6 @@ import com.google.common.base.Predicates; import com.google.javascript.jscomp.CodingConvention.SubclassRelationship; import com.google.javascript.jscomp.ReferenceCollectingCallback.Behavior; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.TypeI; diff --git a/src/com/google/javascript/jscomp/ReferenceCollectingCallback.java b/src/com/google/javascript/jscomp/ReferenceCollectingCallback.java index 8c7b93384b2..730f9b72bfc 100644 --- a/src/com/google/javascript/jscomp/ReferenceCollectingCallback.java +++ b/src/com/google/javascript/jscomp/ReferenceCollectingCallback.java @@ -16,7 +16,6 @@ package com.google.javascript.jscomp; -import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; @@ -28,7 +27,6 @@ import com.google.javascript.rhino.StaticSymbolTable; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -389,214 +387,4 @@ public interface Behavior { public void afterExitScope(NodeTraversal t, ReferenceMap referenceMap) {} }; - /** - * A collection of references. Can be subclassed to apply checks or - * store additional state when adding. - */ - public static final class ReferenceCollection implements Iterable { - - List references = new ArrayList<>(); - - @Override - public Iterator iterator() { - return references.iterator(); - } - - void add(Reference reference) { - references.add(reference); - } - - /** - * Determines if the variable for this reference collection is - * "well-defined." A variable is well-defined if we can prove at - * compile-time that it's assigned a value before it's used. - * - * Notice that if this function returns false, this doesn't imply that the - * variable is used before it's assigned. It just means that we don't - * have enough information to make a definitive judgment. - */ - protected boolean isWellDefined() { - int size = references.size(); - if (size == 0) { - return false; - } - - // If this is a declaration that does not instantiate the variable, - // it's not well-defined. - Reference init = getInitializingReference(); - if (init == null) { - return false; - } - - checkState(references.get(0).isDeclaration()); - BasicBlock initBlock = init.getBasicBlock(); - for (int i = 1; i < size; i++) { - if (!initBlock.provablyExecutesBefore( - references.get(i).getBasicBlock())) { - return false; - } - } - - return true; - } - - /** - * Whether the variable is escaped into an inner function. - */ - boolean isEscaped() { - Scope hoistScope = null; - for (Reference ref : references) { - if (hoistScope == null) { - hoistScope = ref.getScope().getClosestHoistScope(); - } else if (hoistScope != ref.getScope().getClosestHoistScope()) { - return true; - } - } - return false; - } - - /** - * @param index The index into the references array to look for an - * assigning declaration. - * - * This is either the declaration if a value is assigned (such as - * "var a = 2", "function a()...", "... catch (a)..."). - */ - private boolean isInitializingDeclarationAt(int index) { - Reference maybeInit = references.get(index); - if (maybeInit.isInitializingDeclaration()) { - // This is a declaration that represents the initial value. - // Specifically, var declarations without assignments such as "var a;" - // are not. - return true; - } - return false; - } - - /** - * @param index The index into the references array to look for an - * initialized assignment reference. That is, an assignment immediately - * follow a variable declaration that itself does not initialize the - * variable. - */ - private boolean isInitializingAssignmentAt(int index) { - if (index < references.size() && index > 0) { - Reference maybeDecl = references.get(index - 1); - if (maybeDecl.isVarDeclaration() || maybeDecl.isLetDeclaration()) { - checkState(!maybeDecl.isInitializingDeclaration()); - Reference maybeInit = references.get(index); - if (maybeInit.isSimpleAssignmentToName()) { - return true; - } - } - } - return false; - } - - /** - * @return The reference that provides the value for the variable at the - * time of the first read, if known, otherwise null. - * - * This is either the variable declaration ("var a = ...") or first - * reference following the declaration if it is an assignment. - */ - Reference getInitializingReference() { - if (isInitializingDeclarationAt(0)) { - return references.get(0); - } else if (isInitializingAssignmentAt(1)) { - return references.get(1); - } - return null; - } - - /** - * Constants are allowed to be defined after their first use. - */ - Reference getInitializingReferenceForConstants() { - int size = references.size(); - for (int i = 0; i < size; i++) { - if (isInitializingDeclarationAt(i) || isInitializingAssignmentAt(i)) { - return references.get(i); - } - } - return null; - } - - /** - * @return Whether the variable is only assigned a value once for its - * lifetime. - */ - boolean isAssignedOnceInLifetime() { - Reference ref = getOneAndOnlyAssignment(); - if (ref == null) { - return false; - } - - // Make sure this assignment is not in a loop or an enclosing function. - for (BasicBlock block = ref.getBasicBlock(); - block != null; block = block.getParent()) { - if (block.isFunction()) { - if (ref.getSymbol().getScope().getClosestHoistScope() - != ref.getScope().getClosestHoistScope()) { - return false; - } - break; - } else if (block.isLoop()) { - return false; - } - } - - return true; - } - - /** - * @return The one and only assignment. Returns null if the number of assignments is not - * exactly one. - */ - private Reference getOneAndOnlyAssignment() { - Reference assignment = null; - int size = references.size(); - for (int i = 0; i < size; i++) { - Reference ref = references.get(i); - if (ref.isLvalue() || ref.isInitializingDeclaration()) { - if (assignment == null) { - assignment = ref; - } else { - return null; - } - } - } - return assignment; - } - - /** - * @return Whether the variable is never assigned a value. - */ - boolean isNeverAssigned() { - int size = references.size(); - for (int i = 0; i < size; i++) { - Reference ref = references.get(i); - if (ref.isLvalue() || ref.isInitializingDeclaration()) { - return false; - } - } - return true; - } - - boolean firstReferenceIsAssigningDeclaration() { - int size = references.size(); - return size > 0 && references.get(0).isInitializingDeclaration(); - } - - @Override - public String toString() { - return toStringHelper(this) - .add("initRef", getInitializingReference()) - .add("references", references) - .add("wellDefined", isWellDefined()) - .add("assignedOnce", isAssignedOnceInLifetime()) - .toString(); - } - } - } diff --git a/src/com/google/javascript/jscomp/ReferenceCollection.java b/src/com/google/javascript/jscomp/ReferenceCollection.java new file mode 100644 index 00000000000..415c95265e5 --- /dev/null +++ b/src/com/google/javascript/jscomp/ReferenceCollection.java @@ -0,0 +1,218 @@ +/* + * Copyright 2017 The Closure Compiler Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.javascript.jscomp; + +import static com.google.common.base.MoreObjects.toStringHelper; +import static com.google.common.base.Preconditions.checkState; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * A collection of references. Can be subclassed to apply checks or store additional state when + * adding. + */ +public final class ReferenceCollection implements Iterable { + + List references = new ArrayList<>(); + + @Override + public Iterator iterator() { + return references.iterator(); + } + + void add(Reference reference) { + references.add(reference); + } + + /** + * Determines if the variable for this reference collection is "well-defined." A variable is + * well-defined if we can prove at compile-time that it's assigned a value before it's used. + * + *

Notice that if this function returns false, this doesn't imply that the variable is used + * before it's assigned. It just means that we don't have enough information to make a definitive + * judgment. + */ + protected boolean isWellDefined() { + int size = references.size(); + if (size == 0) { + return false; + } + + // If this is a declaration that does not instantiate the variable, + // it's not well-defined. + Reference init = getInitializingReference(); + if (init == null) { + return false; + } + + checkState(references.get(0).isDeclaration()); + BasicBlock initBlock = init.getBasicBlock(); + for (int i = 1; i < size; i++) { + if (!initBlock.provablyExecutesBefore(references.get(i).getBasicBlock())) { + return false; + } + } + + return true; + } + + /** Whether the variable is escaped into an inner function. */ + boolean isEscaped() { + Scope hoistScope = null; + for (Reference ref : references) { + if (hoistScope == null) { + hoistScope = ref.getScope().getClosestHoistScope(); + } else if (hoistScope != ref.getScope().getClosestHoistScope()) { + return true; + } + } + return false; + } + + /** + * @param index The index into the references array to look for an assigning declaration. + *

This is either the declaration if a value is assigned (such as "var a = 2", "function + * a()...", "... catch (a)..."). + */ + private boolean isInitializingDeclarationAt(int index) { + Reference maybeInit = references.get(index); + if (maybeInit.isInitializingDeclaration()) { + // This is a declaration that represents the initial value. + // Specifically, var declarations without assignments such as "var a;" + // are not. + return true; + } + return false; + } + + /** + * @param index The index into the references array to look for an initialized assignment + * reference. That is, an assignment immediately follow a variable declaration that itself + * does not initialize the variable. + */ + private boolean isInitializingAssignmentAt(int index) { + if (index < references.size() && index > 0) { + Reference maybeDecl = references.get(index - 1); + if (maybeDecl.isVarDeclaration() || maybeDecl.isLetDeclaration()) { + checkState(!maybeDecl.isInitializingDeclaration()); + Reference maybeInit = references.get(index); + if (maybeInit.isSimpleAssignmentToName()) { + return true; + } + } + } + return false; + } + + /** + * @return The reference that provides the value for the variable at the time of the first read, + * if known, otherwise null. + *

This is either the variable declaration ("var a = ...") or first reference following the + * declaration if it is an assignment. + */ + Reference getInitializingReference() { + if (isInitializingDeclarationAt(0)) { + return references.get(0); + } else if (isInitializingAssignmentAt(1)) { + return references.get(1); + } + return null; + } + + /** Constants are allowed to be defined after their first use. */ + Reference getInitializingReferenceForConstants() { + int size = references.size(); + for (int i = 0; i < size; i++) { + if (isInitializingDeclarationAt(i) || isInitializingAssignmentAt(i)) { + return references.get(i); + } + } + return null; + } + + /** @return Whether the variable is only assigned a value once for its lifetime. */ + boolean isAssignedOnceInLifetime() { + Reference ref = getOneAndOnlyAssignment(); + if (ref == null) { + return false; + } + + // Make sure this assignment is not in a loop or an enclosing function. + for (BasicBlock block = ref.getBasicBlock(); block != null; block = block.getParent()) { + if (block.isFunction()) { + if (ref.getSymbol().getScope().getClosestHoistScope() + != ref.getScope().getClosestHoistScope()) { + return false; + } + break; + } else if (block.isLoop()) { + return false; + } + } + + return true; + } + + /** + * @return The one and only assignment. Returns null if the number of assignments is not exactly + * one. + */ + private Reference getOneAndOnlyAssignment() { + Reference assignment = null; + int size = references.size(); + for (int i = 0; i < size; i++) { + Reference ref = references.get(i); + if (ref.isLvalue() || ref.isInitializingDeclaration()) { + if (assignment == null) { + assignment = ref; + } else { + return null; + } + } + } + return assignment; + } + + /** @return Whether the variable is never assigned a value. */ + boolean isNeverAssigned() { + int size = references.size(); + for (int i = 0; i < size; i++) { + Reference ref = references.get(i); + if (ref.isLvalue() || ref.isInitializingDeclaration()) { + return false; + } + } + return true; + } + + boolean firstReferenceIsAssigningDeclaration() { + int size = references.size(); + return size > 0 && references.get(0).isInitializingDeclaration(); + } + + @Override + public String toString() { + return toStringHelper(this) + .add("initRef", getInitializingReference()) + .add("references", references) + .add("wellDefined", isWellDefined()) + .add("assignedOnce", isAssignedOnceInLifetime()) + .toString(); + } +} diff --git a/src/com/google/javascript/jscomp/SideEffectsAnalysis.java b/src/com/google/javascript/jscomp/SideEffectsAnalysis.java index 870c94fa8d3..1b42b44e392 100644 --- a/src/com/google/javascript/jscomp/SideEffectsAnalysis.java +++ b/src/com/google/javascript/jscomp/SideEffectsAnalysis.java @@ -20,7 +20,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.javascript.jscomp.NodeTraversal.AbstractShallowCallback; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.VariableVisibilityAnalysis.VariableVisibility; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; diff --git a/src/com/google/javascript/jscomp/VariableReferenceCheck.java b/src/com/google/javascript/jscomp/VariableReferenceCheck.java index 5cd37ed44e6..e92fbdf6b5e 100644 --- a/src/com/google/javascript/jscomp/VariableReferenceCheck.java +++ b/src/com/google/javascript/jscomp/VariableReferenceCheck.java @@ -20,7 +20,6 @@ import com.google.common.collect.Sets; import com.google.javascript.jscomp.NodeTraversal.AbstractShallowCallback; import com.google.javascript.jscomp.ReferenceCollectingCallback.Behavior; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.JSDocInfo; import com.google.javascript.rhino.Node; diff --git a/src/com/google/javascript/jscomp/VariableVisibilityAnalysis.java b/src/com/google/javascript/jscomp/VariableVisibilityAnalysis.java index 3b9bbd4ee25..28badfa0f42 100644 --- a/src/com/google/javascript/jscomp/VariableVisibilityAnalysis.java +++ b/src/com/google/javascript/jscomp/VariableVisibilityAnalysis.java @@ -17,7 +17,6 @@ package com.google.javascript.jscomp; import com.google.common.base.Preconditions; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.rhino.Node; import java.util.HashMap; diff --git a/test/com/google/javascript/jscomp/GlobalVarReferenceMapTest.java b/test/com/google/javascript/jscomp/GlobalVarReferenceMapTest.java index ad256134501..65ed8ecfaf9 100644 --- a/test/com/google/javascript/jscomp/GlobalVarReferenceMapTest.java +++ b/test/com/google/javascript/jscomp/GlobalVarReferenceMapTest.java @@ -20,7 +20,6 @@ import static com.google.javascript.jscomp.Reference.createRefForTest; import com.google.common.collect.ImmutableList; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; import java.util.ArrayList; diff --git a/test/com/google/javascript/jscomp/ReferenceCollectingCallbackTest.java b/test/com/google/javascript/jscomp/ReferenceCollectingCallbackTest.java index 6ccde77c0f7..0452f1aa72a 100644 --- a/test/com/google/javascript/jscomp/ReferenceCollectingCallbackTest.java +++ b/test/com/google/javascript/jscomp/ReferenceCollectingCallbackTest.java @@ -21,7 +21,6 @@ import static com.google.javascript.jscomp.testing.NodeSubject.assertNode; import com.google.javascript.jscomp.ReferenceCollectingCallback.Behavior; -import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceCollection; import com.google.javascript.jscomp.ReferenceCollectingCallback.ReferenceMap; import com.google.javascript.rhino.Token;