Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 59a684c69f63c4d68d44f2a8dc40ae08323c9063..a52f3c2ebe5a52f8c4a5732238deab88be9faead 100755 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -461,7 +461,14 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source, |
ScriptDataImpl* pre_data = input_pre_data; |
if (pre_data == NULL |
&& source_length >= FLAG_min_preparse_length) { |
- pre_data = ParserApi::PartialPreParse(source, NULL, extension); |
+ if (source->IsExternalTwoByteString()) { |
+ ExternalTwoByteStringUC16CharacterStream stream( |
+ Handle<ExternalTwoByteString>::cast(source), 0, source->length()); |
+ pre_data = ParserApi::PartialPreParse(&stream, extension); |
+ } else { |
+ GenericStringUC16CharacterStream stream(source, 0, source->length()); |
+ pre_data = ParserApi::PartialPreParse(&stream, extension); |
+ } |
} |
// Create a script object describing the script to be compiled. |