12015-03-20 Geoffrey Garen <ggaren@apple.com>
2
3 FunctionBodyNode should known where its parameters started
4 https://bugs.webkit.org/show_bug.cgi?id=142926
5
6 Reviewed by NOBODY (OOPS!).
7
8 This will allow us to re-parse parameters instead of keeping the
9 parameters piece of the AST around forever.
10
11 I also took the opportunity to initialized most FunctionBodyNode data
12 members at construction time, to help clarify that they are set right.
13
14 * parser/ASTBuilder.h:
15 (JSC::ASTBuilder::createFunctionExpr): No need to pass
16 functionKeywordStart here; we now provide it at FunctionBodyNode
17 creation time.
18
19 (JSC::ASTBuilder::createFunctionBody): Require everything we need at
20 construction time, including the start of our parameters.
21
22 (JSC::ASTBuilder::createGetterOrSetterProperty):
23 (JSC::ASTBuilder::createFuncDeclStatement): No need to pass
24 functionKeywordStart here; we now provide it at FunctionBodyNode
25 creation time.
26
27 (JSC::ASTBuilder::setFunctionNameStart): Deleted.
28
29 * parser/Nodes.cpp:
30 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize everything at
31 construction time.
32
33 * parser/Nodes.h: Added a field for the location of our parameters.
34
35 * parser/Parser.cpp:
36 (JSC::Parser<LexerType>::parseFunctionBody):
37 (JSC::Parser<LexerType>::parseFunctionInfo):
38 (JSC::Parser<LexerType>::parseFunctionDeclaration):
39 (JSC::Parser<LexerType>::parseClass):
40 (JSC::Parser<LexerType>::parsePropertyMethod):
41 (JSC::Parser<LexerType>::parseGetterSetter):
42 (JSC::Parser<LexerType>::parsePrimaryExpression):
43 * parser/Parser.h: Refactored to match above interface changes.
44
45 * parser/SyntaxChecker.h:
46 (JSC::SyntaxChecker::createFunctionExpr):
47 (JSC::SyntaxChecker::createFunctionBody):
48 (JSC::SyntaxChecker::createFuncDeclStatement):
49 (JSC::SyntaxChecker::createGetterOrSetterProperty): Refactored to match
50 above interface changes.
51
52 (JSC::SyntaxChecker::setFunctionNameStart): Deleted.
53