Author: [email protected]
Date: Fri Jul 3 05:08:00 2009
New Revision: 2353
Modified:
branches/bleeding_edge/src/string.js
Log:
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
Modified: branches/bleeding_edge/src/string.js
==============================================================================
--- branches/bleeding_edge/src/string.js (original)
+++ branches/bleeding_edge/src/string.js Fri Jul 3 05:08:00 2009
@@ -433,7 +433,7 @@
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 @@
}
parameters[j] = index;
parameters[j + 1] = subject;
- return ToString(replace.apply(null, parameters));
+ return replace.apply(null, parameters);
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---