Commit 267f72f5 authored by Andreas Gal's avatar Andreas Gal
Browse files

Merge.

parents 6dfe36b4 ccd993a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ user_pref("accessibility.typeaheadfind.autostart", false);
user_pref("javascript.options.showInConsole", true);
user_pref("layout.debug.enable_data_xbl", true);
user_pref("browser.EULA.override", true);
user_pref("javascript.options.jit.content", true);

user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
"""
+1 −1
Original line number Diff line number Diff line
@@ -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)
+3 −3
Original line number Diff line number Diff line
@@ -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
+21 −0
Original line number Diff line number Diff line
@@ -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(","));