From 311826322271d2d5068b80a1845fe707e09fa2ba Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Tue, 16 Nov 1999 23:53:33 +0000 Subject: [PATCH] r=norris Fix for toString under 1.2 - calls toSource which provides extra '{}' that doesn't match previous behaviour. --- js/src/jsobj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/src/jsobj.c b/js/src/jsobj.c index f3b9e82ed4e2..60b2efb12f6b 100644 --- a/js/src/jsobj.c +++ b/js/src/jsobj.c @@ -432,7 +432,10 @@ js_obj_toSource(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, #endif JSString *idstr, *valstr, *str; - outermost = (cx->sharpObjectMap.depth == 0); + /* obj_toString for 1.2 calls toSource, and doesn't + want the extra parens on the outside */ + outermost = (cx->version != JSVERSION_1_2) + && (cx->sharpObjectMap.depth == 0); he = js_EnterSharpObject(cx, obj, &ida, &chars); if (!he) return JS_FALSE;