Commit 1efb5784 authored by sandholm@chromium.org's avatar sandholm@chromium.org

Fix sputnik regression introduced in r6747.

Review URL: http://codereview.chromium.org/6485025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6752 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3ef7ca6c
...@@ -103,6 +103,7 @@ function StringConcat() { ...@@ -103,6 +103,7 @@ function StringConcat() {
// ECMA-262 section 15.5.4.7 // ECMA-262 section 15.5.4.7
function StringIndexOf(pattern /* position */) { // length == 1 function StringIndexOf(pattern /* position */) { // length == 1
var subject = TO_STRING_INLINE(this); var subject = TO_STRING_INLINE(this);
pattern = TO_STRING_INLINE(pattern);
var index = 0; var index = 0;
if (%_ArgumentsLength() > 1) { if (%_ArgumentsLength() > 1) {
index = %_Arguments(1); // position index = %_Arguments(1); // position
...@@ -110,7 +111,7 @@ function StringIndexOf(pattern /* position */) { // length == 1 ...@@ -110,7 +111,7 @@ function StringIndexOf(pattern /* position */) { // length == 1
if (index < 0) index = 0; if (index < 0) index = 0;
if (index > subject.length) index = subject.length; if (index > subject.length) index = subject.length;
} }
return %StringIndexOf(subject, TO_STRING_INLINE(pattern), index); return %StringIndexOf(subject, pattern, index);
} }
...@@ -401,8 +402,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) { ...@@ -401,8 +402,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) {
lastMatchInfoOverride = override; lastMatchInfoOverride = override;
var func_result = var func_result =
%_CallFunction(receiver, elem, match_start, subject, replace); %_CallFunction(receiver, elem, match_start, subject, replace);
func_result = TO_STRING_INLINE(func_result); res[i] = TO_STRING_INLINE(func_result);
res[i] = func_result;
match_start += elem.length; match_start += elem.length;
} }
i++; i++;
...@@ -415,8 +415,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) { ...@@ -415,8 +415,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) {
// Use the apply argument as backing for global RegExp properties. // Use the apply argument as backing for global RegExp properties.
lastMatchInfoOverride = elem; lastMatchInfoOverride = elem;
var func_result = replace.apply(null, elem); var func_result = replace.apply(null, elem);
func_result = TO_STRING_INLINE(func_result); res[i] = TO_STRING_INLINE(func_result);
res[i] = func_result;
} }
i++; i++;
} }
......
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