Reviewers: Mads Ager,

Description:
Remove unneeded ToString calls. We call ToString if necessary
when the result of calling the replace function is added to the
ReplaceResultBuilder.

Please review this at http://codereview.chromium.org/149179

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/string.js


Index: src/string.js
===================================================================
--- src/string.js       (revision 2352)
+++ src/string.js       (working copy)
@@ -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
-~----------~----~----~----~------~----~------~--~---

Reply via email to