| Index: src/preparser.h
|
| diff --git a/src/preparser.h b/src/preparser.h
|
| index cb1d5fb4eb7baa65ef4d8c8973cb067796e9ce6d..7756343b8145bea6c15ab038d8771fc579ca3e46 100644
|
| --- a/src/preparser.h
|
| +++ b/src/preparser.h
|
| @@ -110,6 +110,12 @@ class PreParser {
|
| kPreParseSuccess
|
| };
|
|
|
| + enum Flags {
|
| + kNoFlags = 0,
|
| + kAllowLazy = 1,
|
| + kAllowNativesSyntax = 2
|
| + };
|
| +
|
| ~PreParser() {}
|
|
|
| // Pre-parse the program from the character stream; returns true on
|
| @@ -118,9 +124,12 @@ class PreParser {
|
| // during parsing.
|
| static PreParseResult PreParseProgram(i::JavaScriptScanner* scanner,
|
| i::ParserRecorder* log,
|
| - bool allow_lazy,
|
| + int flags,
|
| uintptr_t stack_limit) {
|
| - return PreParser(scanner, log, stack_limit, allow_lazy).PreParse();
|
| + bool allow_lazy = (flags & kAllowLazy) != 0;
|
| + bool allow_natives_syntax = (flags & kAllowNativesSyntax) != 0;
|
| + return PreParser(scanner, log, stack_limit,
|
| + allow_lazy, allow_natives_syntax).PreParse();
|
| }
|
|
|
| private:
|
| @@ -437,7 +446,8 @@ class PreParser {
|
| PreParser(i::JavaScriptScanner* scanner,
|
| i::ParserRecorder* log,
|
| uintptr_t stack_limit,
|
| - bool allow_lazy)
|
| + bool allow_lazy,
|
| + bool allow_natives_syntax)
|
| : scanner_(scanner),
|
| log_(log),
|
| scope_(NULL),
|
| @@ -445,7 +455,8 @@ class PreParser {
|
| strict_mode_violation_location_(i::Scanner::Location::invalid()),
|
| strict_mode_violation_type_(NULL),
|
| stack_overflow_(false),
|
| - allow_lazy_(true),
|
| + allow_lazy_(allow_lazy),
|
| + allow_natives_syntax_(allow_natives_syntax),
|
| parenthesized_function_(false),
|
| harmony_scoping_(scanner->HarmonyScoping()) { }
|
|
|
| @@ -607,6 +618,7 @@ class PreParser {
|
| const char* strict_mode_violation_type_;
|
| bool stack_overflow_;
|
| bool allow_lazy_;
|
| + bool allow_natives_syntax_;
|
| bool parenthesized_function_;
|
| bool harmony_scoping_;
|
| };
|
|
|