archives

« Bugzilla Issues Index

#2780 — 21.2.5.7 RegExp.prototype.replace: Restrict position to [0, s.length]


21.2.5.7 RegExp.prototype.replace ( string, replaceValue ), step 17.d-17.e

Add new steps after 17.e:

> Let stringLength be the number of code units in S.
> Let position be max(min(position, stringLength), 0).

See assertions in 21.1.3.14.1 GetReplaceSubstitution, steps 5-6.


fixed in rev25 editor's draft


fixed in rev25 editor's draft