Index: src/runtime/runtime-regexp.cc |
diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc |
index 406c98fc60d95e7ed47f736ac82186e952d05a5e..acefe0767b3cb1de46eb3882be9f808993817d22 100644 |
--- a/src/runtime/runtime-regexp.cc |
+++ b/src/runtime/runtime-regexp.cc |
@@ -738,20 +738,20 @@ RUNTIME_FUNCTION(Runtime_StringSplit) { |
DCHECK(result->HasFastObjectElements()); |
- if (part_count == 1 && indices.at(0) == subject_length) { |
- FixedArray::cast(result->elements())->set(0, *subject); |
- return *result; |
- } |
- |
Handle<FixedArray> elements(FixedArray::cast(result->elements())); |
- int part_start = 0; |
- for (int i = 0; i < part_count; i++) { |
- HandleScope local_loop_handle(isolate); |
- int part_end = indices.at(i); |
- Handle<String> substring = |
- isolate->factory()->NewProperSubString(subject, part_start, part_end); |
- elements->set(i, *substring); |
- part_start = part_end + pattern_length; |
+ |
+ if (part_count == 1 && indices.at(0) == subject_length) { |
+ elements->set(0, *subject); |
+ } else { |
+ int part_start = 0; |
+ for (int i = 0; i < part_count; i++) { |
+ HandleScope local_loop_handle(isolate); |
+ int part_end = indices.at(i); |
+ Handle<String> substring = |
+ isolate->factory()->NewProperSubString(subject, part_start, part_end); |
+ elements->set(i, *substring); |
+ part_start = part_end + pattern_length; |
+ } |
} |
if (limit == 0xffffffffu) { |