public abstract class Module
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
abstract com.google.common.collect.ImmutableMap<java.lang.String,Binding> |
boundNames()
Map of local identifiers to originating binding.
|
abstract java.lang.String |
closureNamespace()
The specific Closure namespace this module represents, if any.
|
abstract com.google.common.collect.ImmutableMap<java.lang.String,Export> |
localNameToLocalExport()
Map of local identifier name to local export definition.
|
abstract ModuleMetadataMap.ModuleMetadata |
metadata() |
abstract com.google.common.collect.ImmutableMap<java.lang.String,Binding> |
namespace()
Map of exported identifiers to originating binding.
|
abstract ModuleLoader.ModulePath |
path()
Path of this module.
|
public abstract ModuleMetadataMap.ModuleMetadata metadata()
@Nullable public abstract ModuleLoader.ModulePath path()
goog.loadModule
.public abstract com.google.common.collect.ImmutableMap<java.lang.String,Binding> namespace()
Note that the keys are different than boundNames()
. Here the keys are the exported
name, not the local name.
Examples:
export let x;
, let x; export {x as v};
) creates an entry with the exported name for the local module's export
definition.
export default function foo() {};
creates an entry with the name "default"
for the local module's default export definition.
export {x as v} from 'mod';
creates an entry with the name "v" for the
export definition x from 'mod'.
import
statements make no entries on their own. If imported values are
exported with export {};
then an entry is created like export {} from
.
public abstract com.google.common.collect.ImmutableMap<java.lang.String,Binding> boundNames()
This includes all names bound by import and exported names which originate in this module. Used for rewriting in later stages of the compiler.
Examples:
import {x as v} from 'mod';
creates an entry with the name "v" for the
export definition x from 'mod'.
import * as ns from 'mod';
creates an entry with the name "ns" with a
binding containing all of mod's bindings.
export default function foo() {}
creates an entry with the name "foo" for
the local module's export definition.
export {x as v} from 'mod';
does not create any entry in this module.
public abstract com.google.common.collect.ImmutableMap<java.lang.String,Export> localNameToLocalExport()
@Nullable public abstract java.lang.String closureNamespace()
goog.provide
, goog.module
, or goog.module.declareNamespace
. Null otherwise.Copyright © 2009-2019 Google. All Rights Reserved.