/** * @param node * @return */ private IMatchLocatorValue createFunctionDeclaration(FunctionStatement node, Identifier name) { final JSMethod method = new JSMethod(node, referenceSource); jsdocSupport.processMethod(node, method, fReporter, fTypeChecker); final FunctionNode functionNode; if (node.isDeclaration()) { functionNode = new FunctionDeclaration(peek(), node, method); } else { functionNode = new FunctionExpression(peek(), node, method); } method.setLocation( ReferenceLocation.create( referenceSource, node.start(), node.end(), functionNode.getNameNode())); functionNode.buildArgumentNodes(); push(functionNode); addFunctionDeclaration(name, node, method); visitFunctionBody(node); pop(); return null; }