mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
ee5f8e441f
commit
c6a7088bae
@ -60,7 +60,7 @@ BUILTIN3(String_p_concat_1int, LO, LO, LO, P, JSString*, JSContest*, JSString*
|
||||
BUILTIN4(String_p_match, LO, LO, LO, LO, P, JSObject*, JSContext*, JSString*, jsbytecode*, JSObject*, 1, 1)
|
||||
BUILTIN4(String_p_replace_str, LO, LO, LO, LO, P, JSString*, JSContext*, JSString*, JSObject*, JSString*, 1, 1)
|
||||
BUILTIN5(String_p_replace_str3, LO, LO, LO, LO, LO, P, JSString*, JSContext*, JSString*, JSString*, JSString*, JSString*, 1, 1)
|
||||
BUILTIN3(String_p_split, LO, LO, LO, P, JSString*, JSContext*, JSString*, JSString*, 1, 1)
|
||||
BUILTIN3(String_p_split, LO, LO, LO, P, JSObject*, JSContext*, JSString*, JSString*, 1, 1)
|
||||
BUILTIN1(Math_random, LO, F, jsdouble, JSRuntime*, 1, 1)
|
||||
BUILTIN2(EqualStrings, LO, LO, LO, bool, JSString*, JSString*, 1, 1)
|
||||
BUILTIN2(CompareStrings, LO, LO, LO, bool, JSString*, JSString*, 1, 1)
|
||||
|
@ -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
|
||||
|
@ -813,6 +813,27 @@ function newArrayTest()
|
||||
newArrayTest.expected="0,0,0,0,0,0,0,0,0,0";
|
||||
test(newArrayTest);
|
||||
|
||||
function stringSplitTest()
|
||||
{
|
||||
var s = "a,b"
|
||||
var a = null;
|
||||
for (var i = 0; i < 10; ++i)
|
||||
a = s.split(",");
|
||||
return a.join();
|
||||
}
|
||||
stringSplitTest.expected="a,b";
|
||||
test(stringSplitTest);
|
||||
|
||||
function stringSplitIntoArrayTest()
|
||||
{
|
||||
var s = "a,b"
|
||||
var a = [];
|
||||
for (var i = 0; i < 10; ++i)
|
||||
a[i] = s.split(",");
|
||||
return a.join();
|
||||
}
|
||||
stringSplitIntoArrayTest.expected="a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b";
|
||||
test(stringSplitIntoArrayTest);
|
||||
|
||||
/* Keep these at the end so that we can see the summary after the trace-debug spew. */
|
||||
print("\npassed:", passes.length && passes.join(","));
|
||||
|
Loading…
Reference in New Issue
Block a user