| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 5047dbd49b98366310fc493caeebd25f4d31340e..e8003b6731cc77740ed36596a90a59fcfe957027 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -2912,8 +2912,7 @@ MUST_USE_RESULT static MaybeObject* StringReplaceAtomRegExpWithString(
|
|
|
| int matches = indices.length();
|
| if (matches == 0) {
|
| - JSRegExp::ResetLastIndex(isolate, pattern_regexp);
|
| - return *subject;
|
| + return isolate->heap()->undefined_value();
|
| }
|
|
|
| // Detect integer overflow.
|
| @@ -3015,8 +3014,7 @@ MUST_USE_RESULT static MaybeObject* StringReplaceRegExpWithString(
|
| int32_t* current_match = global_cache.FetchNext();
|
| if (current_match == NULL) {
|
| if (global_cache.HasException()) return Failure::Exception();
|
| - JSRegExp::ResetLastIndex(isolate, regexp);
|
| - return *subject;
|
| + return isolate->heap()->undefined_value();
|
| }
|
|
|
| // Guessing the number of parts that the final result string is built
|
| @@ -3114,8 +3112,7 @@ MUST_USE_RESULT static MaybeObject* StringReplaceRegExpWithEmptyString(
|
| int32_t* current_match = global_cache.FetchNext();
|
| if (current_match == NULL) {
|
| if (global_cache.HasException()) return Failure::Exception();
|
| - JSRegExp::ResetLastIndex(isolate, regexp);
|
| - return *subject;
|
| + return isolate->heap()->undefined_value();
|
| }
|
|
|
| int start = current_match[0];
|
|
|