if (!(url = JS_GetInstancePrivate(cx, obj, &lm_location_class, argv))) return JS_FALSE; url->url_decoder->replace_location = JS_TRUE;  ans = loc_assign(cx, obj, 0, argv); *rval = *argv; return ans;
if (!JSVAL_IS_INT(id)) return JS_TRUE;  slot = JSVAL_TO_INT(id);  if (slot < 0 || slot == URL_TARGET) return url_setProperty(cx, obj, id, vp);   if (!JSVAL_IS_STRING(*vp) && !JS_ConvertValue(cx, *vp, JSTYPE_STRING, vp)) { return JS_FALSE; }   if (slot == URL_HREF || slot == URL_PROTOCOL) {  url_string = JS_GetStringBytes(JSVAL_TO_STRING(*vp)); url_string = lm_CheckURL(cx, url_string, JS_TRUE); if (!url_string) return JS_FALSE; str = JS_NewStringCopyZ(cx, url_string); XP_FREE((char *)url_string); if (!str) return JS_FALSE; val = STRING_TO_JSVAL(str); vp = &val; } else {  if (!loc_getProperty(cx, obj, INT_TO_JSVAL(URL_HREF), &val)) return JS_FALSE; }   if (!url_setProperty(cx, obj, id, vp)) return JS_FALSE;  url = JS_GetPrivate(cx, obj); if (!url) return JS_TRUE; if (url->href) url_string = JS_GetStringBytes(url->href); else url_string = ""; return url_load(cx, obj, url_string, NET_DONT_RELOAD);
PR_STATIC_CALLBACK(JSBool)loc_replace(JSContext *cx, JSObject *obj,	    uint argc, jsval *argv, jsval *rval){    JSURL *url;    JSBool ans;    if (!(url = JS_GetInstancePrivate(cx, obj, &lm_location_class, argv)))        return JS_FALSE;    url->url_decoder->replace_location = JS_TRUE;    /* Note: loc_assign ignores the id in favor of its own id anyway */    ans = loc_assign(cx, obj, 0, argv);    *rval = *argv;    return ans;}