ASTFunctionNode extends AbstractEcmascriptNode<FunctionNode> { public EcmascriptNode<?> getBody() { return (EcmascriptNode<?>) getChild(getNumChildren() - 1); } @Deprecated @InternalApi  ASTFunctionNode(FunctionNode functionNode); @Override Object jjtAccept(EcmascriptParserVisitor visitor, Object data); int getNumParams(); ASTName getFunctionName(); EcmascriptNode<?> getParam(int index); EcmascriptNode<?> getBody(); @Deprecated // use getBody() instead EcmascriptNode<?> getBody(int index); boolean isClosure(); boolean isGetter(); boolean isSetter(); boolean isGetterOrSetter();  }
@Test public void testGetBody() { ASTAstRoot node = js.parse("function foo() { var a = 'a'; }"); ASTFunctionNode fn = node.getFirstDescendantOfType(ASTFunctionNode.class); Assert.assertFalse(fn.isClosure()); EcmascriptNode<?> body = fn.getBody(); Assert.assertTrue(body instanceof ASTBlock); }