public final class JsFunction extends JsLiteral implements HasName
Modifier and Type | Field and Description |
---|---|
protected JsBlock |
body |
protected List<JsParameter> |
params |
protected JsScope |
scope |
Constructor and Description |
---|
JsFunction(SourceInfo sourceInfo,
JsScope parent)
Creates an anonymous function.
|
JsFunction(SourceInfo sourceInfo,
JsScope parent,
JsName name)
Creates a function that is not derived from Java source.
|
JsFunction(SourceInfo sourceInfo,
JsScope parent,
JsName name,
boolean fromJava)
Creates a named function, possibly derived from Java source.
|
Modifier and Type | Method and Description |
---|---|
static JsFunction |
createSentinel()
Creates a dummy JsFunction object to be used as a sentinel.
|
JsBlock |
getBody() |
InliningMode |
getInliningMode() |
NodeKind |
getKind() |
JsName |
getName() |
List<JsParameter> |
getParameters() |
JsScope |
getScope() |
JsFunction |
getSuperClinit() |
boolean |
hasSideEffects()
Determines whether the expression can cause side effects.
|
boolean |
isBooleanFalse() |
boolean |
isBooleanTrue() |
boolean |
isClinit()
Returns whether this function is the implementation of a class initiliazer.
|
boolean |
isDefinitelyNull()
True if the target expression is definitely null.
|
boolean |
isFromJava() |
boolean |
isInliningAllowed() |
void |
markAsClinit() |
void |
setBody(JsBlock body) |
void |
setFromJava(boolean fromJava) |
void |
setInliningMode(InliningMode inliningMode) |
void |
setName(JsName name) |
void |
setSuperClinit(JsFunction superClinit) |
void |
traverse(JsVisitor v,
JsContext ctx)
Causes this object to have the visitor visit itself and its children.
|
isInternable
isLeaf, makeStmt
getSourceInfo, setSourceInfo, toSource, toSource, toString
protected JsBlock body
protected final List<JsParameter> params
protected final JsScope scope
public JsFunction(SourceInfo sourceInfo, JsScope parent)
public JsFunction(SourceInfo sourceInfo, JsScope parent, JsName name)
public JsFunction(SourceInfo sourceInfo, JsScope parent, JsName name, boolean fromJava)
public static JsFunction createSentinel()
public JsBlock getBody()
public boolean isClinit()
public JsFunction getSuperClinit()
public InliningMode getInliningMode()
public List<JsParameter> getParameters()
public JsScope getScope()
public boolean hasSideEffects()
JsExpression
hasSideEffects
in class JsExpression
public boolean isBooleanFalse()
isBooleanFalse
in interface CanBooleanEval
public boolean isBooleanTrue()
isBooleanTrue
in interface CanBooleanEval
public boolean isDefinitelyNull()
JsExpression
isDefinitelyNull
in class JsExpression
public boolean isFromJava()
public boolean isInliningAllowed()
public void markAsClinit()
public void setBody(JsBlock body)
public void setFromJava(boolean fromJava)
public void setSuperClinit(JsFunction superClinit)
public void setInliningMode(InliningMode inliningMode)
public void setName(JsName name)
public void traverse(JsVisitor v, JsContext ctx)
JsVisitable
traverse
in interface JsVisitable
v
- the visitor that should traverse this nodectx
- the context of an existing traversalCopyright © 2018. All rights reserved.