| Index: src/preparser.h
|
| diff --git a/src/preparser.h b/src/preparser.h
|
| index 647a142b1a152d31fe059fbd72224450bca9d3b5..41543d54ef075b6d711e705ff4ecc3d83efb217c 100644
|
| --- a/src/preparser.h
|
| +++ b/src/preparser.h
|
| @@ -110,6 +110,24 @@ class PreParser {
|
| kPreParseSuccess
|
| };
|
|
|
| +
|
| + PreParser(i::Scanner* scanner,
|
| + i::ParserRecorder* log,
|
| + uintptr_t stack_limit,
|
| + bool allow_lazy,
|
| + bool allow_natives_syntax)
|
| + : scanner_(scanner),
|
| + log_(log),
|
| + scope_(NULL),
|
| + stack_limit_(stack_limit),
|
| + strict_mode_violation_location_(i::Scanner::Location::invalid()),
|
| + strict_mode_violation_type_(NULL),
|
| + stack_overflow_(false),
|
| + allow_lazy_(allow_lazy),
|
| + allow_natives_syntax_(allow_natives_syntax),
|
| + parenthesized_function_(false),
|
| + harmony_scoping_(scanner->HarmonyScoping()) { }
|
| +
|
| ~PreParser() {}
|
|
|
| // Pre-parse the program from the character stream; returns true on
|
| @@ -126,6 +144,17 @@ class PreParser {
|
| allow_lazy, allow_natives_syntax).PreParse();
|
| }
|
|
|
| + // Parses a single function literal, from the opening parentheses before
|
| + // parameters to the closing brace after the body.
|
| + // Returns a FunctionEntry describing the body of the funciton in enough
|
| + // detail that it can be lazily compiled.
|
| + // The scanner is expected to have matched the "function" keyword and
|
| + // parameters, and have consumed the initial '{'.
|
| + // At return, unless an error occured, the scanner is positioned before the
|
| + // the final '}'.
|
| + PreParseResult PreParseLazyFunction(bool strict_mode,
|
| + i::ParserRecorder* log);
|
| +
|
| private:
|
| // Used to detect duplicates in object literals. Each of the values
|
| // kGetterProperty, kSetterProperty and kValueProperty represents
|
| @@ -448,24 +477,6 @@ class PreParser {
|
| i::StrictModeFlag strict_mode_flag_;
|
| };
|
|
|
| - // Private constructor only used in PreParseProgram.
|
| - PreParser(i::Scanner* scanner,
|
| - i::ParserRecorder* log,
|
| - uintptr_t stack_limit,
|
| - bool allow_lazy,
|
| - bool allow_natives_syntax)
|
| - : scanner_(scanner),
|
| - log_(log),
|
| - scope_(NULL),
|
| - stack_limit_(stack_limit),
|
| - strict_mode_violation_location_(i::Scanner::Location::invalid()),
|
| - strict_mode_violation_type_(NULL),
|
| - stack_overflow_(false),
|
| - allow_lazy_(allow_lazy),
|
| - allow_natives_syntax_(allow_natives_syntax),
|
| - parenthesized_function_(false),
|
| - harmony_scoping_(scanner->HarmonyScoping()) { }
|
| -
|
| // Preparse the program. Only called in PreParseProgram after creating
|
| // the instance.
|
| PreParseResult PreParse() {
|
| @@ -545,6 +556,7 @@ class PreParser {
|
|
|
| Arguments ParseArguments(bool* ok);
|
| Expression ParseFunctionLiteral(bool* ok);
|
| + void ParseLazyFunctionLiteralBody(bool* ok);
|
|
|
| Identifier ParseIdentifier(bool* ok);
|
| Identifier ParseIdentifierName(bool* ok);
|
|
|