Skip to content

Commit d60ff52

Browse files
committed
Remove no longer relevant lastIndex code from replace method #287
1 parent c3342b5 commit d60ff52

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/xregexp.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,11 +1545,6 @@ fixed.replace = function(search, replacement) {
15451545
}
15461546
}
15471547
}
1548-
// Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, Safari
1549-
// bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1)
1550-
if (isRegex && search.global) {
1551-
search.lastIndex = args[args.length - 2] + args[0].length;
1552-
}
15531548
// ES6 specs the context for replacement functions as `undefined`
15541549
return replacement(...args);
15551550
});

0 commit comments

Comments
 (0)