Fix for toString under 1.2 - calls toSource which provides extra '{}' that
doesn't match previous behaviour.
This commit is contained in:
rogerl%netscape.com 1999-11-16 23:53:33 +00:00
Родитель 69be334452
Коммит 3118263222
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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;