String.prototype.replace works incorrectly with RegExp assertion ?=
Author: YLeightCreated Oct 13, 2016Updated Oct 17, 2016
Labelsnoncompliant ES5
In case when we have regular expression with assertion ?=, the wrappedReplaceValue, which decorate the original replaceValue function, can't define correct arguments, because the coincidence which was passed to replaceValue function don't match the RegExp pattern and the final arguments have just only two values - the offset of the matched sub-string within the whole string being examined, and the whole string being examined.
There is a certain problem, when whole RegExp don't match with found coincidence, but in fact, there is a coincidence StringPrototype.replace polyfill
Source: es-shims/es5-shim