Bug 523670 - Add assertion to detect proto-less dense arrays. r=brendan.

This commit is contained in:
Jason Orendorff
2009-10-23 14:40:36 -05:00
parent aeb32a492b
commit e662f38d3b

View File

@@ -3457,6 +3457,12 @@ js_NewArrayObject(JSContext *cx, jsuint length, jsval *vector, JSBool holey)
if (!obj)
return NULL;
/*
* If this fails, the global object was not initialized and its class does
* not have JSCLASS_IS_GLOBAL.
*/
JS_ASSERT(obj->getProto());
JS_PUSH_TEMP_ROOT_OBJECT(cx, obj, &tvr);
if (!InitArrayObject(cx, obj, length, vector, holey))
obj = NULL;