diff options
Diffstat (limited to 'deps/v8/src/handles.cc')
-rw-r--r-- | deps/v8/src/handles.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/deps/v8/src/handles.cc b/deps/v8/src/handles.cc index c9984aa92f..8c6439b227 100644 --- a/deps/v8/src/handles.cc +++ b/deps/v8/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(); + 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); } } |