зеркало из https://github.com/mozilla/pjs.git
Bug 699661. Call the class getElement hook from JSObject::getElement as needed. r=waldo
This commit is contained in:
Родитель
cda72c22df
Коммит
df9df30469
|
@ -842,7 +842,7 @@ array_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index,
|
|||
if (!obj->isDenseArray())
|
||||
return js_GetElement(cx, obj, index, vp);
|
||||
|
||||
if (index < obj->getDenseArrayCapacity() &&
|
||||
if (index < obj->getDenseArrayInitializedLength() &&
|
||||
!obj->getDenseArrayElement(index).isMagic(JS_ARRAY_HOLE))
|
||||
{
|
||||
*vp = obj->getDenseArrayElement(index);
|
||||
|
|
|
@ -1238,6 +1238,10 @@ JSObject::lookupSpecial(JSContext *cx, js::SpecialId sid, JSObject **objp, JSPro
|
|||
inline JSBool
|
||||
JSObject::getElement(JSContext *cx, JSObject *receiver, uint32 index, js::Value *vp)
|
||||
{
|
||||
js::ElementIdOp op = getOps()->getElement;
|
||||
if (op)
|
||||
return op(cx, this, receiver, index, vp);
|
||||
|
||||
jsid id;
|
||||
if (!js::IndexToId(cx, index, &id))
|
||||
return false;
|
||||
|
@ -1247,10 +1251,7 @@ JSObject::getElement(JSContext *cx, JSObject *receiver, uint32 index, js::Value
|
|||
inline JSBool
|
||||
JSObject::getElement(JSContext *cx, uint32 index, js::Value *vp)
|
||||
{
|
||||
jsid id;
|
||||
if (!js::IndexToId(cx, index, &id))
|
||||
return false;
|
||||
return getGeneric(cx, id, vp);
|
||||
return getElement(cx, this, index, vp);
|
||||
}
|
||||
|
||||
inline JSBool
|
||||
|
|
Загрузка…
Ссылка в новой задаче