Bug 505523 - Property cache can skip JSClass::resolve or JSClass::addProperty hooks. r=graydon, r=brendan.

This commit is contained in:
Jason Orendorff
2009-11-18 14:29:58 -06:00
parent 81b0aa7cec
commit e3bdbd7b65
12 changed files with 196 additions and 123 deletions

View File

@@ -1297,9 +1297,9 @@ js_MakeArraySlow(JSContext *cx, JSObject *obj)
/* obj is Array.prototype. */
emptyShape = js_GenerateShape(cx, false);
} else {
/* arrayProto is Array.prototype. */
JS_ASSERT(arrayProto->getClass() == &js_SlowArrayClass);
if (!OBJ_SCOPE(arrayProto)->getEmptyScopeShape(cx, &js_SlowArrayClass, &emptyShape))
return JS_FALSE;
emptyShape = OBJ_SCOPE(arrayProto)->emptyScope->shape;
}
JSScope *scope = JSScope::create(cx, &js_SlowArrayObjectOps, &js_SlowArrayClass, obj,
emptyShape);