| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index cc8056402d88dc3859facd8fe85e530a686a196c..5fd0893216759a666231427ce0965566831666e2 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -11440,8 +11440,10 @@ int String::IndexOf(Isolate* isolate, Handle<String> receiver,
|
| }
|
|
|
| MaybeHandle<String> String::GetSubstitution(Isolate* isolate, Match* match,
|
| - Handle<String> replacement) {
|
| + Handle<String> replacement,
|
| + int start_index) {
|
| DCHECK_IMPLIES(match->HasNamedCaptures(), FLAG_harmony_regexp_named_captures);
|
| + DCHECK_GE(start_index, 0);
|
|
|
| Factory* factory = isolate->factory();
|
|
|
| @@ -11452,7 +11454,8 @@ MaybeHandle<String> String::GetSubstitution(Isolate* isolate, Match* match,
|
|
|
| Handle<String> dollar_string =
|
| factory->LookupSingleCharacterStringFromCode('$');
|
| - int next_dollar_ix = String::IndexOf(isolate, replacement, dollar_string, 0);
|
| + int next_dollar_ix =
|
| + String::IndexOf(isolate, replacement, dollar_string, start_index);
|
| if (next_dollar_ix < 0) {
|
| return replacement;
|
| }
|
|
|