| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index ef04ed34f0d8cdff397d6938c4d528a86954ade9..5047dbd49b98366310fc493caeebd25f4d31340e 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -1794,7 +1794,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpInitializeObject) {
|
| JSRegExp::kIgnoreCaseFieldIndex, ignoreCase, SKIP_WRITE_BARRIER);
|
| regexp->InObjectPropertyAtPut(
|
| JSRegExp::kMultilineFieldIndex, multiline, SKIP_WRITE_BARRIER);
|
| - regexp->ResetLastIndex();
|
| + regexp->InObjectPropertyAtPut(
|
| + JSRegExp::kLastIndexFieldIndex, Smi::FromInt(0), SKIP_WRITE_BARRIER);
|
| return regexp;
|
| }
|
|
|
| @@ -2911,7 +2912,7 @@ MUST_USE_RESULT static MaybeObject* StringReplaceAtomRegExpWithString(
|
|
|
| int matches = indices.length();
|
| if (matches == 0) {
|
| - pattern_regexp->ResetLastIndex();
|
| + JSRegExp::ResetLastIndex(isolate, pattern_regexp);
|
| return *subject;
|
| }
|
|
|
| @@ -3014,7 +3015,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();
|
| - regexp->ResetLastIndex();
|
| + JSRegExp::ResetLastIndex(isolate, regexp);
|
| return *subject;
|
| }
|
|
|
| @@ -3113,7 +3114,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();
|
| - regexp->ResetLastIndex();
|
| + JSRegExp::ResetLastIndex(isolate, regexp);
|
| return *subject;
|
| }
|
|
|
|
|