Index: src/handles.cc |
diff --git a/src/handles.cc b/src/handles.cc |
index c9984aa92f3d8c7620dbdfe762cbf06817235ed7..e7d0f9b7e97c5224e37f4cea881b16d81e0d4012 100644 |
--- a/src/handles.cc |
+++ b/src/handles.cc |
@@ -617,15 +617,17 @@ Handle<FixedArray> CalculateLineEnds(Handle<String> src, |
{ |
AssertNoAllocation no_heap_allocation; // ensure vectors stay valid. |
// Dispatch on type of strings. |
- if (src->IsAsciiRepresentation()) { |
+ String::FlatContent content = src->GetFlatContent(no_heap_allocation); |
+ ASSERT(content.IsFlat()); |
+ if (content.IsAscii()) { |
CalculateLineEnds(isolate, |
&line_ends, |
- src->ToAsciiVector(), |
+ content.ToAsciiVector(), |
with_last_line); |
} else { |
CalculateLineEnds(isolate, |
&line_ends, |
- src->ToUC16Vector(), |
+ content.ToUC16Vector(), |
with_last_line); |
} |
} |