public class NodeUtil extends Object
Constructor and Description |
---|
NodeUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
conditionFromHasNode(com.google.javascript.rhino.Node cursor)
If the specified node represents a has() function call, then return the
formal parameter of the function call if it is a string literal, and the
result of the function call is used as a boolean value.
|
static com.google.javascript.rhino.Node |
moduleDepsFromConfigDeps(com.google.javascript.rhino.Node cursor,
String configVarName)
If the specified node is for a property named 'deps' and the property is
a member of the object identified by
configVarName , and the
'deps' property is being assigned an array literal, then return the node
for the array literal, else return null. |
static com.google.javascript.rhino.Node |
moduleDepsFromDefine(com.google.javascript.rhino.Node cursor)
If the specified node represents a define() function call, then return
the node for the dependency list, else return null.
|
static com.google.javascript.rhino.Node |
moduleDepsFromRequire(com.google.javascript.rhino.Node cursor)
If the specified node represents a require() function call, then return
the node for the dependency list, else return null.
|
public static String conditionFromHasNode(com.google.javascript.rhino.Node cursor)
cursor
- the node specifying a has() function callpublic static com.google.javascript.rhino.Node moduleDepsFromDefine(com.google.javascript.rhino.Node cursor)
cursor
- the node for a define() function callpublic static com.google.javascript.rhino.Node moduleDepsFromRequire(com.google.javascript.rhino.Node cursor)
cursor
- the node for a require() function callpublic static com.google.javascript.rhino.Node moduleDepsFromConfigDeps(com.google.javascript.rhino.Node cursor, String configVarName)
configVarName
, and the
'deps' property is being assigned an array literal, then return the node
for the array literal, else return null.
For example, if configVarName
is require
and
the specified node is for the 'deps' property in
require.deps = ["foo", "bar"];
, then this method will return
the node for the array. Various flavors of the assignment are supported.
cursor
- the node for the 'deps' property.configVarName
- The name of the object containing the 'deps' property.Copyright © 2011-2015 IBM. All Rights Reserved.