Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index dc8cec240fa8f9329519eafacd6c9f7b71c2e107..f41a81acc6aa2f84663f8069a7e4f3549e4e54a5 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -5121,17 +5121,16 @@ int ScriptDataImpl::ReadNumber(byte** source) { |
// Create a Scanner for the preparser to use as input, and preparse the source. |
static ScriptDataImpl* DoPreParse(UC16CharacterStream* source, |
- bool allow_lazy, |
- ParserRecorder* recorder, |
- bool harmony_scoping) { |
+ int flags, |
+ ParserRecorder* recorder) { |
Isolate* isolate = Isolate::Current(); |
JavaScriptScanner scanner(isolate->unicode_cache()); |
- scanner.SetHarmonyScoping(harmony_scoping); |
+ scanner.SetHarmonyScoping((flags & kHarmonyScoping) != 0); |
scanner.Initialize(source); |
intptr_t stack_limit = isolate->stack_guard()->real_climit(); |
if (!preparser::PreParser::PreParseProgram(&scanner, |
recorder, |
- allow_lazy, |
+ flags, |
stack_limit)) { |
isolate->StackOverflow(); |
return NULL; |
@@ -5148,25 +5147,28 @@ static ScriptDataImpl* DoPreParse(UC16CharacterStream* source, |
// even if the preparser data is only used once. |
ScriptDataImpl* ParserApi::PartialPreParse(UC16CharacterStream* source, |
v8::Extension* extension, |
- bool harmony_scoping) { |
+ int flags) { |
bool allow_lazy = FLAG_lazy && (extension == NULL); |
if (!allow_lazy) { |
// Partial preparsing is only about lazily compiled functions. |
// If we don't allow lazy compilation, the log data will be empty. |
return NULL; |
} |
+ flags |= kAllowLazy; |
PartialParserRecorder recorder; |
- return DoPreParse(source, allow_lazy, &recorder, harmony_scoping); |
+ return DoPreParse(source, flags, &recorder); |
} |
ScriptDataImpl* ParserApi::PreParse(UC16CharacterStream* source, |
v8::Extension* extension, |
- bool harmony_scoping) { |
+ int flags) { |
Handle<Script> no_script; |
- bool allow_lazy = FLAG_lazy && (extension == NULL); |
+ if (FLAG_lazy && (extension == NULL)) { |
+ flags |= kAllowLazy; |
+ } |
CompleteParserRecorder recorder; |
- return DoPreParse(source, allow_lazy, &recorder, harmony_scoping); |
+ return DoPreParse(source, flags, &recorder); |
} |