public abstract class Binding
extends java.lang.Object
See Module.namespace()
and Module.boundNames()
for how Bindings are used.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
boundName()
The name of the variable this export is bound to, assuming it is not a binding of a module
namespace.
|
abstract java.lang.String |
closureNamespace() |
abstract com.google.javascript.jscomp.modules.Binding.CreatedBy |
createdBy() |
boolean |
isCreatedByEsImport()
Returns whether this Binding originated from an ES import, as opposed to an export or
goog.require.
|
abstract boolean |
isModuleNamespace()
True if this represents a module namespace, e.g.
|
boolean |
isMutated()
Returns whether or not this export is potentially mutated after module execution (i.e.
|
abstract ModuleMetadataMap.ModuleMetadata |
metadata()
Metadata of the module this is bound to.
|
abstract Export |
originatingExport()
Returns the original export if this binding was created by an export.
|
abstract Node |
sourceNode()
The AST node to use for source location when rewriting.
|
public abstract ModuleMetadataMap.ModuleMetadata metadata()
If this was made from an import *
then it is the module that this imported.
Otherwise it is the module this binding was created in (e.g. the module of the originating
export).
@Nullable public abstract Node sourceNode()
This is generally a NAME or IMPORT_STAR node inside an import or export statement that
represents where the name was bound. However as export * from
has no NAME nodes the
source node in that instance should be the entire export node.
Null for missing ES modules and non-ES modules as they are currently not scanned.
@Nullable public abstract Export originatingExport()
For transitive exports this will still be the *original* export, not the transitive link.
public abstract boolean isModuleNamespace()
import *
@Nullable public abstract java.lang.String closureNamespace()
public abstract com.google.javascript.jscomp.modules.Binding.CreatedBy createdBy()
public final java.lang.String boundName()
public final boolean isMutated()
public final boolean isCreatedByEsImport()
Copyright © 2009-2019 Google. All Rights Reserved.