Revision: 6752
Author: [email protected]
Date: Fri Feb 11 05:30:37 2011
Log: Fix sputnik regression introduced in r6747.
Review URL: http://codereview.chromium.org/6485025
http://code.google.com/p/v8/source/detail?r=6752

Modified:
 /branches/bleeding_edge/src/string.js

=======================================
--- /branches/bleeding_edge/src/string.js       Fri Feb 11 04:33:30 2011
+++ /branches/bleeding_edge/src/string.js       Fri Feb 11 05:30:37 2011
@@ -103,6 +103,7 @@
 // ECMA-262 section 15.5.4.7
 function StringIndexOf(pattern /* position */) {  // length == 1
   var subject = TO_STRING_INLINE(this);
+  pattern = TO_STRING_INLINE(pattern);
   var index = 0;
   if (%_ArgumentsLength() > 1) {
     index = %_Arguments(1);  // position
@@ -110,7 +111,7 @@
     if (index < 0) index = 0;
     if (index > subject.length) index = subject.length;
   }
-  return %StringIndexOf(subject, TO_STRING_INLINE(pattern), index);
+  return %StringIndexOf(subject, pattern, index);
 }


@@ -401,8 +402,7 @@
         lastMatchInfoOverride = override;
         var func_result =
             %_CallFunction(receiver, elem, match_start, subject, replace);
-        func_result = TO_STRING_INLINE(func_result);
-        res[i] = func_result;
+        res[i] = TO_STRING_INLINE(func_result);
         match_start += elem.length;
       }
       i++;
@@ -415,8 +415,7 @@
         // Use the apply argument as backing for global RegExp properties.
         lastMatchInfoOverride = elem;
         var func_result = replace.apply(null, elem);
-        func_result = TO_STRING_INLINE(func_result);
-        res[i] = func_result;
+        res[i] = TO_STRING_INLINE(func_result);
       }
       i++;
     }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to