Bug 453345 - Only look at pn_extra if we're actually a list. r=brendan

This commit is contained in:
Blake Kaplan 2008-09-08 11:47:15 -07:00
parent 999e6c6956
commit 1e443bad7c

View File

@ -1941,7 +1941,7 @@ CheckDestructuring(JSContext *cx, BindData *data,
}
#if JS_HAS_DESTRUCTURING_SHORTHAND
if (right && (right->pn_extra & PNX_SHORTHAND)) {
if (right && right->pn_arity == PN_LIST && (right->pn_extra & PNX_SHORTHAND)) {
js_ReportCompileErrorNumber(cx, TS(tc->parseContext), right,
JSREPORT_ERROR, JSMSG_BAD_OBJECT_INIT);
return JS_FALSE;