File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1323,17 +1323,17 @@ class Interface extends InterfaceConstructor {
1323
1323
default :
1324
1324
if ( typeof s === 'string' && s ) {
1325
1325
let nextMatch = RegExpPrototypeExec ( lineEnding , s ) ;
1326
- // If no line endings are found, just insert the string as is
1326
+ // If no line endings are found, just insert the string as is.
1327
1327
if ( nextMatch === null ) {
1328
1328
this [ kInsertString ] ( s ) ;
1329
1329
} else {
1330
- // Keep track of the end of the last match
1330
+ // Keep track of the end of the last match.
1331
1331
let lastIndex = 0 ;
1332
1332
do {
1333
1333
this [ kInsertString ] ( StringPrototypeSlice ( s , lastIndex , nextMatch . index ) ) ;
1334
1334
( { lastIndex } = lineEnding ) ;
1335
1335
this [ kLine ] ( ) ;
1336
- // Restore lastIndex locally as the RegExp's state might have been overwritten by recursive calls
1336
+ // Restore lastIndex as the call to kLine could have mutated it.
1337
1337
lineEnding . lastIndex = lastIndex ;
1338
1338
} while ( ( nextMatch = RegExpPrototypeExec ( lineEnding , s ) ) !== null ) ;
1339
1339
}
You can’t perform that action at this time.
0 commit comments