When the namespacing feature is on, inside the fixed.replace() method it it adds a new object to the end of args (https://github.com/slevithan/xregexp/blob/v4.3.0/src/xregexp.js#L1523). Later the search.lastIndex is set using the second to last item in args which is meant to be the "offset" (https://github.com/slevithan/xregexp/blob/v4.3.0/src/xregexp.js#L1541). The "offset" is no longer at args.length - 2 but instead is now at args.length - 3. The way it is now, if namespacing is on, it sets search.lastIndex to the original string with number of arguments appended to the end.