Commit 07bbacc8 authored by kasperl@chromium.org's avatar kasperl@chromium.org

Remove unneeded ToString calls. We call ToString if necessary

when the result of calling the replace function is added to the
ReplaceResultBuilder.
Review URL: http://codereview.chromium.org/149179

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2353 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4cccc960
......@@ -433,7 +433,7 @@ function ApplyReplacementFunction(replace, lastMatchInfo, subject) {
if (m == 1) {
var s = CaptureString(subject, lastMatchInfo, 0);
// Don't call directly to avoid exposing the built-in global object.
return ToString(replace.call(null, s, index, subject));
return replace.call(null, s, index, subject);
}
var parameters = $Array(m + 2);
for (var j = 0; j < m; j++) {
......@@ -441,7 +441,7 @@ function ApplyReplacementFunction(replace, lastMatchInfo, subject) {
}
parameters[j] = index;
parameters[j + 1] = subject;
return ToString(replace.apply(null, parameters));
return replace.apply(null, parameters);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment