Found dead code. Will upload a new revision without it.
http://codereview.chromium.org/10134057/diff/1/src/string.js File src/string.js (right): http://codereview.chromium.org/10134057/diff/1/src/string.js#newcode400 src/string.js:400: // ReplaceResultBuilder On 2012/04/26 08:38:54, Erik Corry wrote:
Comment out of date
Done. http://codereview.chromium.org/10134057/diff/1/src/string.js#newcode406 src/string.js:406: if (start < 0) return; On 2012/04/26 08:38:54, Erik Corry wrote:
This return seems wrong. Should we not return a string?
The tests need beefing up to catch this.
Turns out this is dead code. addCaptureString is only called by ExpandReplacement, which is only called for the String.replace(<string>, <string including $-replacements>) case. In that case, numbered captures can not occur since the search pattern is a string and not a regexp. The actual work for replacing with numbered captures is implemented in CompiledReplacement http://codereview.chromium.org/10134057/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
