- All Superinterfaces:
ExpressionTree
,Tree
A tree node for yield expressions used in generator functions.
For example:
function* id(){ var index = 0; while(index < 10) yield index++; }
- Since:
- 9
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the expression that is yielded.boolean
isStar()
Is this a yield * expression in a generator function? For example:Methods inherited from interface org.openjdk.nashorn.api.tree.Tree
accept, getEndPosition, getKind, getStartPosition
-
Method Details
-
getExpression
ExpressionTree getExpression()Returns the expression that is yielded.- Returns:
- The expression that is yielded.
-
isStar
boolean isStar()Is this a yield * expression in a generator function? For example:function* id(){ yield 1; yield * anotherGeneratorFunc(); yield 10; }
- Returns:
- true if this is a yield * expression
-