Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
Modifier and Type | Field and Description |
---|---|
(package private) GlobalNamespace.Name |
GlobalNamespace.Ref.name |
(package private) GlobalNamespace.Name |
ProcessDefines.CollectDefines.RefInfo.name |
(package private) GlobalNamespace.Name |
GlobalNamespace.Name.parent |
Modifier and Type | Field and Description |
---|---|
private java.util.List<GlobalNamespace.Name> |
CollapseProperties.globalNames
Global namespace tree
|
private java.util.List<GlobalNamespace.Name> |
GlobalNamespace.globalNames
Global namespace tree
|
private java.util.Map<java.lang.String,GlobalNamespace.Name> |
CollapseProperties.nameMap
Maps names (e.g.
|
private java.util.Map<java.lang.String,GlobalNamespace.Name> |
GlobalNamespace.nameMap
Maps names (e.g.
|
(package private) java.util.List<GlobalNamespace.Name> |
GlobalNamespace.Name.props |
Modifier and Type | Method and Description |
---|---|
(package private) GlobalNamespace.Name |
GlobalNamespace.Name.addProperty(java.lang.String name,
boolean inExterns) |
(package private) GlobalNamespace.Name |
GlobalNamespace.BuildGlobalNamespace.getOrCreateName(java.lang.String name)
Gets a
GlobalNamespace.Name instance for a global name. |
GlobalNamespace.Name |
GlobalNamespace.getOwnSlot(java.lang.String name) |
GlobalNamespace.Name |
GlobalNamespace.getSlot(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<GlobalNamespace.Name> |
GlobalNamespace.getAllSymbols() |
(package private) java.util.List<GlobalNamespace.Name> |
GlobalNamespace.getNameForest()
Gets a list of the roots of the forest of the global names, where the
roots are the top-level names.
|
(package private) java.util.Map<java.lang.String,GlobalNamespace.Name> |
GlobalNamespace.getNameIndex()
Gets an index of all the global names, indexed by full qualified name
(as in "a", "a.b.c", etc.).
|
Modifier and Type | Method and Description |
---|---|
private int |
CollapseProperties.addStubsForUndeclaredProperties(GlobalNamespace.Name n,
java.lang.String alias,
Node parent,
Node addAfter)
Adds global variable "stubs" for any properties of a global name that are
only set in a local scope or read but never set.
|
private void |
CheckGlobalNames.checkDescendantNames(GlobalNamespace.Name name,
boolean nameIsDefined)
Checks to make sure all the descendants of a name are defined if they
are referenced.
|
private void |
CollapseProperties.checkForHosedThisReferences(Node function,
JSDocInfo docInfo,
GlobalNamespace.Name name)
Warns about any references to "this" in the given FUNCTION.
|
private void |
CollapseProperties.collapseDeclarationOfNameAndDescendants(GlobalNamespace.Name n,
java.lang.String alias)
Collapses definitions of the collapsible properties of a global name.
|
private int |
CollapseProperties.declareVarsForObjLitValues(GlobalNamespace.Name objlitName,
java.lang.String alias,
Node objlit,
Node varNode,
Node nameToAddAfter,
Node varParent)
Declares global variables to serve as aliases for the values in an object
literal, optionally removing all of the object literal's keys and values.
|
private void |
CollapseProperties.flattenPrefixes(java.lang.String alias,
GlobalNamespace.Name n,
int depth)
Flattens all occurrences of a name as a prefix of subnames beginning
with a particular subname.
|
private void |
CollapseProperties.flattenReferencesTo(GlobalNamespace.Name n,
java.lang.String alias)
Flattens all references to a collapsible property of a global name except
its initial definition.
|
private void |
CollapseProperties.flattenReferencesToCollapsibleDescendantNames(GlobalNamespace.Name n,
java.lang.String alias)
Flattens all references to collapsible properties of a global name except
their initial definitions.
|
private void |
CollapseProperties.flattenSimpleStubDeclaration(GlobalNamespace.Name name,
java.lang.String alias)
Flattens a stub declaration.
|
java.lang.Iterable<GlobalNamespace.Ref> |
GlobalNamespace.getReferences(GlobalNamespace.Name slot) |
StaticTypedScope<TypeI> |
GlobalNamespace.getScope(GlobalNamespace.Name slot) |
private boolean |
CollapseProperties.inlineAliasIfPossible(GlobalNamespace.Name name,
GlobalNamespace.Ref alias,
GlobalNamespace namespace) |
private boolean |
CollapseProperties.inlineGlobalAliasIfPossible(GlobalNamespace.Name name,
GlobalNamespace.Ref alias,
GlobalNamespace namespace)
Attempt to inline an global alias of a global name.
|
private boolean |
CheckGlobalNames.propertyMustBeInitializedByFullName(GlobalNamespace.Name name)
The input name is a property.
|
private void |
CheckGlobalNames.reportBadModuleReference(GlobalNamespace.Name name,
GlobalNamespace.Ref ref) |
private void |
CheckGlobalNames.reportRefToUndefinedName(GlobalNamespace.Name name,
GlobalNamespace.Ref ref) |
private static void |
CollapseProperties.rewriteAliasProps(GlobalNamespace.Name name,
Node value,
int depth,
java.util.Set<GlobalNamespace.AstChange> newNodes) |
private void |
CollapseProperties.updateFunctionDeclarationAtFunctionNode(GlobalNamespace.Name n,
boolean canCollapseChildNames)
Updates the first initialization (a.k.a "declaration") of a global name
that occurs at a FUNCTION node.
|
private void |
CollapseProperties.updateObjLitOrFunctionDeclaration(GlobalNamespace.Name n,
java.lang.String alias,
boolean canCollapseChildNames)
Updates the first initialization (a.k.a "declaration") of a global name.
|
private void |
CollapseProperties.updateObjLitOrFunctionDeclarationAtAssignNode(GlobalNamespace.Name n,
java.lang.String alias,
boolean canCollapseChildNames)
Updates the first initialization (a.k.a "declaration") of a global name
that occurs at an ASSIGN node.
|
private void |
CollapseProperties.updateObjLitOrFunctionDeclarationAtVarNode(GlobalNamespace.Name n,
boolean canCollapseChildNames)
Updates the first initialization (a.k.a "declaration") of a global name
that occurs at a VAR node.
|
private void |
CollapseProperties.updateSimpleDeclaration(java.lang.String alias,
GlobalNamespace.Name refName,
GlobalNamespace.Ref ref)
Updates the initial assignment to a collapsible property at global scope
by changing it to a variable declaration (e.g.
|
private void |
CheckGlobalNames.validateName(GlobalNamespace.Name name,
boolean isDefined) |
private void |
CollapseProperties.warnAboutNamespaceAliasing(GlobalNamespace.Name nameObj,
GlobalNamespace.Ref ref)
Reports a warning because a namespace was aliased.
|
private void |
CollapseProperties.warnAboutNamespaceRedefinition(GlobalNamespace.Name nameObj,
GlobalNamespace.Ref ref)
Reports a warning because a namespace was redefined.
|
Constructor and Description |
---|
Name(java.lang.String name,
GlobalNamespace.Name parent,
boolean inExterns) |
Ref(JSModule module,
Scope scope,
Node node,
GlobalNamespace.Name name,
GlobalNamespace.Ref.Type type,
int index)
Creates a reference at the current node.
|
RefInfo(GlobalNamespace.Ref ref,
GlobalNamespace.Name name) |
Constructor and Description |
---|
CollectDefines(AbstractCompiler compiler,
java.util.List<GlobalNamespace.Name> listOfDefines) |