if (cx->localeCallbacks && cx->localeCallbacks->localeToUnicode) return cx->localeCallbacks->localeToUnicode(cx, buf, rval);
date_toLocaleHelper(JSContext *cx, JSObject *obj, uintN argc,		    jsval *argv, jsval *rval, char *format){    char buf[100];    JSString *str;    PRMJTime split;    jsdouble *date = date_getProlog(cx, obj, argv);    if (!date)	return JS_FALSE;    if (!JSDOUBLE_IS_FINITE(*date)) {	JS_snprintf(buf, sizeof buf, js_NaN_date_str);    } else {	intN result_len;	jsdouble local = LocalTime(*date);	new_explode(local, &split, JS_FALSE);	/* let PRMJTime format it.	 */	result_len = PRMJ_FormatTime(buf, sizeof buf, format, &split);	/* If it failed, default to toString. */	if (result_len == 0)	    return date_format(cx, *date, FORMATSPEC_FULL, rval);        /* Hacked check against undesired 2-digit year 00/00/00 form. */        if (buf[result_len - 3] == '/' &&            isdigit(buf[result_len - 2]) && isdigit(buf[result_len - 1])) {            JS_snprintf(buf + (result_len - 2), (sizeof buf) - (result_len - 2),                        "%d", js_DateGetYear(cx, obj));        }    }    if (cx->localeCallbacks && cx->localeCallbacks->localeToUnicode)        return cx->localeCallbacks->localeToUnicode(cx, buf, rval);        str = JS_NewStringCopyZ(cx, buf);    if (!str)	return JS_FALSE;    *rval = STRING_TO_JSVAL(str);    return JS_TRUE;}