1717 * </pre>
1818 */
1919public class FunctionDeclaration extends Statement implements IFunction {
20- private final AFunction <BlockStatement > fn ;
20+ private final AFunction <? extends Node > fn ;
2121 private final boolean hasDeclareKeyword ;
2222 private int symbol = -1 ;
2323
24- public FunctionDeclaration (SourceLocation loc , Identifier id , List <Expression > params , BlockStatement body , boolean generator ,
24+ public FunctionDeclaration (SourceLocation loc , Identifier id , List <Expression > params , Node body , boolean generator ,
2525 boolean async ) {
26- this (loc , new AFunction <BlockStatement >(id , params , body , generator , async , Collections .emptyList (), Collections .emptyList (),
26+ this (loc , new AFunction <>(id , params , body , generator , async , Collections .emptyList (), Collections .emptyList (),
2727 Collections .emptyList (), null , null ),
2828 false );
2929 }
3030
3131 public FunctionDeclaration (SourceLocation loc , Identifier id ,
32- List <Expression > params , BlockStatement body , boolean generator , boolean async , boolean hasDeclareKeyword ,
32+ List <Expression > params , Node body , boolean generator , boolean async , boolean hasDeclareKeyword ,
3333 List <TypeParameter > typeParameters , List <ITypeExpression > parameterTypes , ITypeExpression returnType ,
3434 ITypeExpression thisParameterType ) {
35- this (loc , new AFunction <BlockStatement >(id , params , body , generator , async , typeParameters , parameterTypes , Collections .emptyList (),
35+ this (loc , new AFunction <>(id , params , body , generator , async , typeParameters , parameterTypes , Collections .emptyList (),
3636 returnType , thisParameterType ), hasDeclareKeyword );
3737 }
3838
39- private FunctionDeclaration (SourceLocation loc , AFunction <BlockStatement > fn , boolean hasDeclareKeyword ) {
39+ private FunctionDeclaration (SourceLocation loc , AFunction <Node > fn , boolean hasDeclareKeyword ) {
4040 super ("FunctionDeclaration" , loc );
4141 this .fn = fn ;
4242 this .hasDeclareKeyword = hasDeclareKeyword ;
@@ -56,7 +56,7 @@ public FunctionExpression asFunctionExpression() {
5656 @ Override public boolean hasDefault (int i ) { return fn .hasDefault (i ); }
5757 @ Override public Expression getDefault (int i ) { return fn .getDefault (i ); }
5858 @ Override public IPattern getRest () { return fn .getRest (); }
59- @ Override public BlockStatement getBody () { return fn .getBody (); }
59+ @ Override public Node getBody () { return fn .getBody (); }
6060 @ Override public boolean hasRest () { return fn .hasRest (); }
6161 public boolean hasId () { return fn .hasId (); }
6262 public boolean isGenerator () { return fn .isGenerator (); }
0 commit comments