Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: src/parser.cc

Issue 8590027: Fix the ScopeIterator reimplemantation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.h ('k') | src/runtime.cc » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index e19af1cd5cd3dd265633660544b675246588c17b..2780a8789d8d25daf455a5f4b2d24fbd9c4ac112 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -5374,7 +5374,7 @@ static ScriptDataImpl* DoPreParse(UC16CharacterStream* source,
// Preparse, but only collect data that is immediately useful,
// even if the preparser data is only used once.
-ScriptDataImpl* ParserApi::PartialPreParse(UC16CharacterStream* source,
+ScriptDataImpl* ParserApi::PartialPreParse(Handle<String> source,
v8::Extension* extension,
int flags) {
bool allow_lazy = FLAG_lazy && (extension == NULL);
@@ -5385,7 +5385,15 @@ ScriptDataImpl* ParserApi::PartialPreParse(UC16CharacterStream* source,
}
flags |= kAllowLazy;
PartialParserRecorder recorder;
- return DoPreParse(source, flags, &recorder);
+ int source_length = source->length();
+ if (source->IsExternalTwoByteString()) {
+ ExternalTwoByteStringUC16CharacterStream stream(
+ Handle<ExternalTwoByteString>::cast(source), 0, source_length);
+ return DoPreParse(&stream, flags, &recorder);
+ } else {
+ GenericStringUC16CharacterStream stream(source, 0, source_length);
+ return DoPreParse(&stream, flags, &recorder);
+ }
}
« no previous file with comments | « src/parser.h ('k') | src/runtime.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698