archives

« Bugzilla Issues Index

#2778 — 21.2.5.7 RegExp.prototype.replace: Step 3 is invalid, nCaptures needs to be determined dynamically


21.2.5.7 RegExp.prototype.replace ( string, replaceValue ), step 3.

Remove step 3 and instead add three new step before 17.a to determine the number of captured groups.

> 17.a Let nCaptures be ToLength(Get(result, "length")).
> 17.b ReturnIfAbrupt(nCaptures).
> 17.c Let nCaptures be max(nCaptures - 1, 0).


fixed in rev26 editor's draft


fixed in rev26