Index: src/runtime/runtime-regexp.cc |
diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc |
index 8b7578b667cb38cb1ae1cf4f883f03e3fa09d8fe..fd2826e471cfce695fa2a24e08d690b66e8277df 100644 |
--- a/src/runtime/runtime-regexp.cc |
+++ b/src/runtime/runtime-regexp.cc |
@@ -431,6 +431,9 @@ MUST_USE_RESULT static Object* StringReplaceGlobalAtomRegExpWithString( |
} else { |
result_len = static_cast<int>(result_len_64); |
} |
+ if (result_len == 0) { |
+ return isolate->heap()->empty_string(); |
+ } |
int subject_pos = 0; |
int result_pos = 0; |