-
- All Superinterfaces:
ExpressionTree
,Tree
public interface FunctionExpressionTree extends ExpressionTree
A tree node for function expressions including arrow functions. For example:var func = function ( parameters ) body
var func = (x) => x+1
- Since:
- 9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tree
getBody()
Returns the body of this function.IdentifierTree
getName()
Returns the name of the function being declared.List<? extends ExpressionTree>
getParameters()
Returns the parameters of this function.boolean
isArrow()
Is this a arrow function?boolean
isGenerator()
Is this a generator function?boolean
isStrict()
Is this a strict function?-
Methods inherited from interface jdk.nashorn.api.tree.Tree
accept, getEndPosition, getKind, getStartPosition
-
-
-
-
Method Detail
-
getName
IdentifierTree getName()
Returns the name of the function being declared.- Returns:
- name the function declared
-
getParameters
List<? extends ExpressionTree> getParameters()
Returns the parameters of this function.- Returns:
- the list of parameters
-
getBody
Tree getBody()
Returns the body of this function. This may be aBlockTree
when this function has a block body. This is anExpressionTree
when the function body is a concise expression as in an expression arrow, or in an expression closure.- Returns:
- the body of this function
-
isStrict
boolean isStrict()
Is this a strict function?- Returns:
- true if this function is strict
-
isArrow
boolean isArrow()
Is this a arrow function?- Returns:
- true if this is a arrow function
-
isGenerator
boolean isGenerator()
Is this a generator function?- Returns:
- true if this is a generator function
-
-