From cc77ff001122180631333710519d69764cd2b476 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Wed, 2 Jun 2004 21:10:00 +0000 Subject: [PATCH] Fix [null].toSource() to produce [null], not [] (245148, r=shaver). --- js/src/jsarray.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/jsarray.c b/js/src/jsarray.c index 250c67557b82..a05a6ee3c0c2 100644 --- a/js/src/jsarray.c +++ b/js/src/jsarray.c @@ -335,7 +335,6 @@ array_join_sub(JSContext *cx, JSObject *obj, JSString *sep, JSBool literalize, ok = js_GetLengthProperty(cx, obj, &length); if (!ok) return JS_FALSE; - ok = JS_TRUE; he = js_EnterSharpObject(cx, obj, NULL, &chars); if (!he) @@ -405,7 +404,7 @@ array_join_sub(JSContext *cx, JSObject *obj, JSString *sep, JSBool literalize, if (!ok) goto done; - if (JSVAL_IS_VOID(v) || JSVAL_IS_NULL(v)) { + if (!literalize && (JSVAL_IS_VOID(v) || JSVAL_IS_NULL(v))) { str = cx->runtime->emptyString; } else { if (localeString) {