Bug 451580, fix string split assertions and return values. Tests fail with JIT on for other reasons, it seems. r=shaver

This commit is contained in:
Robert Sayre
2008-08-21 14:06:42 -04:00
parent 1a2a7af9da
commit 7146ca68f4
3 changed files with 25 additions and 4 deletions

View File

@@ -303,15 +303,15 @@ js_String_p_replace_str3(JSContext* cx, JSString* str, JSString* patstr, JSStrin
return JSVAL_TO_STRING(vp[0]);
}
JSString* FASTCALL
JSObject* FASTCALL
js_String_p_split(JSContext* cx, JSString* str, JSString* sepstr)
{
// FIXME: optimize by calling into a lower level exported from jsstr.cpp.
jsval vp[3] = { JSVAL_NULL, STRING_TO_JSVAL(str), STRING_TO_JSVAL(sepstr) };
if (!js_str_split(cx, 2, vp))
return NULL;
JS_ASSERT(JSVAL_IS_STRING(vp[0]));
return JSVAL_TO_STRING(vp[0]);
JS_ASSERT(JSVAL_IS_OBJECT(vp[0]));
return JSVAL_TO_OBJECT(vp[0]);
}
jsdouble FASTCALL