private abstract class ExternExportsPass.Export
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
symbolName |
protected Node |
value |
| Constructor and Description |
|---|
Export(java.lang.String symbolName,
Node value) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
appendExtern(java.lang.String path,
Node valueToExport)
Appends the exported function and all paths necessary for the path to be
declared.
|
private void |
appendPathDefinition(java.lang.String path,
Node initializer) |
private JSDocInfo |
buildEmptyJSDoc() |
private java.util.List<java.lang.String> |
computePathPrefixes(java.lang.String path)
Computes a list of the path prefixes constructed from the components
of the path.
|
private Node |
createExternFunction(Node exportedFunction)
Given a function to export, create the empty function that
will be put in the externs file.
|
private Node |
createExternObjectLit(Node exportedObjectLit)
Given an object literal to export, create an object lit with all its
string properties.
|
(package private) void |
generateExterns()
Generates the externs representation of this export and appends
it to the externsRoot AST.
|
(package private) abstract java.lang.String |
getExportedPath()
Returns the path exported by this export.
|
protected Node |
getValue(Node qualifiedNameNode)
If the given value is a qualified name which refers
a function or object literal, the node is returned.
|
protected final java.lang.String symbolName
protected final Node value
Export(java.lang.String symbolName,
Node value)
void generateExterns()
abstract java.lang.String getExportedPath()
void appendExtern(java.lang.String path,
Node valueToExport)
var a = {};
a.b = {};
a.b.c = function(x,y) { }
private java.util.List<java.lang.String> computePathPrefixes(java.lang.String path)
E.g., if the path is:
"a.b.c"
then then path prefixes will be
["a","a.b","a.b.c"]:
private void appendPathDefinition(java.lang.String path,
Node initializer)
private Node createExternFunction(Node exportedFunction)
private JSDocInfo buildEmptyJSDoc()
private Node createExternObjectLit(Node exportedObjectLit)