mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Avoid recursive death due to JS1.2 toString=>toSource combined with after-the-fact, heretofore unversioned reflection of string chars as enumerable elements (271477, r=jband).
This commit is contained in:
parent
8073e345f4
commit
3fed695bed
@ -529,6 +529,10 @@ str_enumerate(JSContext *cx, JSObject *obj)
|
||||
JSString *str, *str1;
|
||||
size_t i, length;
|
||||
|
||||
/* Avoid infinite recursion via js_obj_toSource (see bug 271477). */
|
||||
if (cx->version == JSVERSION_1_2)
|
||||
return JS_TRUE;
|
||||
|
||||
str = js_ValueToString(cx, OBJECT_TO_JSVAL(obj));
|
||||
if (!str)
|
||||
return JS_FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user