From bd01f00c8856920054e1c533427f41b73fa263ac Mon Sep 17 00:00:00 2001 From: mlm Date: Fri, 17 Apr 1998 21:37:22 +0000 Subject: [PATCH] Minor nit fixes that I intended to check in before, reviewed by Brendan --- lib/libmocha/lm_url.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/libmocha/lm_url.c b/lib/libmocha/lm_url.c index e057be06aa9..dc8e48404e3 100644 --- a/lib/libmocha/lm_url.c +++ b/lib/libmocha/lm_url.c @@ -834,12 +834,10 @@ loc_assign(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSObject *locobj; if (!JS_InstanceOf(cx, obj, &lm_location_class, NULL)) { - if(!JS_LookupProperty(cx, obj, lm_location_str, &v)) { + if(!JS_LookupProperty(cx, obj, "location", &v) || + !JSVAL_IS_OBJECT(v)) { return JS_FALSE; } - if(!JSVAL_IS_OBJECT(v) || !JSVAL_TO_OBJECT(v)) { - return JS_TRUE; - } locobj = JSVAL_TO_OBJECT(v); } else { locobj = obj; @@ -869,6 +867,7 @@ loc_replace(JSContext *cx, JSObject *obj, uint argc, jsval *argv, jsval *rval) { JSURL *url; + jsid jid; JSBool ans; if (!(url = JS_GetInstancePrivate(cx, obj, &lm_location_class, argv))) @@ -921,12 +920,12 @@ lm_DefineLocation(MochaDecoder *decoder) if (!JS_DefineProperty(cx, decoder->window_object, lm_location_str, OBJECT_TO_JSVAL(obj), NULL, loc_assign, - JSPROP_ENUMERATE | JSPROP_PERMANENT)) { + JSPROP_ENUMERATE)) { return NULL; } if (!JS_DefineProperty(cx, decoder->document, lm_location_str, OBJECT_TO_JSVAL(obj), NULL, loc_assign, - JSPROP_ENUMERATE | JSPROP_PERMANENT)) { + JSPROP_ENUMERATE)) { return NULL; }