private void print(FunctionNode node) throws IOException { if (!node.isMethod()) { writer.append("function"); } if (node.getFunctionName() != null) { writer.append(' '); print(node.getFunctionName()); } writer.append('('); printList(node.getParams()); writer.append(')').ws(); if (node.isExpressionClosure()) { if (node.getBody().getLastChild() instanceof ReturnStatement) { print(((ReturnStatement) node.getBody().getLastChild()).getReturnValue()); if (node.getFunctionType() == FunctionNode.FUNCTION_STATEMENT) { writer.append(";"); } } } else { print(node.getBody()); } }
if (body.getLastChild() instanceof ReturnStatement) { body = ((ReturnStatement) body.getLastChild()).getReturnValue(); sb.append(body.toSource(0)); if (functionType == FUNCTION_STATEMENT) {
if (body.getLastChild() instanceof ReturnStatement) { body = ((ReturnStatement) body.getLastChild()).getReturnValue(); sb.append(body.toSource(0)); if (functionType == FUNCTION_STATEMENT) {
if (body.getLastChild() instanceof ReturnStatement) { body = ((ReturnStatement) body.getLastChild()).getReturnValue(); sb.append(body.toSource(0)); if (functionType == FUNCTION_STATEMENT) {
if (body.getLastChild() instanceof ReturnStatement) { body = ((ReturnStatement) body.getLastChild()).getReturnValue(); sb.append(body.toSource(0)); if (functionType == FUNCTION_STATEMENT) {
private void print(FunctionNode node) throws IOException { if (!node.isMethod()) { writer.append("function"); } if (node.getFunctionName() != null) { writer.append(' '); print(node.getFunctionName()); } writer.append('('); printList(node.getParams()); writer.append(')').ws(); if (node.isExpressionClosure()) { if (node.getBody().getLastChild() instanceof ReturnStatement) { print(((ReturnStatement) node.getBody().getLastChild()).getReturnValue()); if (node.getFunctionType() == FunctionNode.FUNCTION_STATEMENT) { writer.append(";"); } } } else { print(node.getBody()); } }