Bug 683361, part 5 - Handle transparent proxies correctly in [[Class]] == "X" queries (r=waldo)
This commit is contained in:
@@ -2888,15 +2888,15 @@ array_concat(JSContext *cx, uintN argc, Value *vp)
|
||||
return false;
|
||||
const Value &v = p[i];
|
||||
if (v.isObject()) {
|
||||
aobj = &v.toObject();
|
||||
if (aobj->isArray() || (aobj->isWrapper() && aobj->unwrap()->isArray())) {
|
||||
JSObject &obj = v.toObject();
|
||||
if (ObjectClassIs(obj, ESClass_Array, cx)) {
|
||||
jsuint alength;
|
||||
if (!js_GetLengthProperty(cx, aobj, &alength))
|
||||
if (!js_GetLengthProperty(cx, &obj, &alength))
|
||||
return false;
|
||||
for (uint32 slot = 0; slot < alength; slot++) {
|
||||
JSBool hole;
|
||||
Value tmp;
|
||||
if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, aobj, slot, &hole, &tmp))
|
||||
if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, &obj, slot, &hole, &tmp))
|
||||
return false;
|
||||
|
||||
/*
|
||||
@@ -3336,11 +3336,11 @@ array_every(JSContext *cx, uintN argc, Value *vp)
|
||||
static JSBool
|
||||
array_isArray(JSContext *cx, uintN argc, Value *vp)
|
||||
{
|
||||
JSObject *obj;
|
||||
vp->setBoolean(argc > 0 &&
|
||||
vp[2].isObject() &&
|
||||
((obj = &vp[2].toObject())->isArray() ||
|
||||
(obj->isWrapper() && obj->unwrap()->isArray())));
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
bool isArray = args.length() > 0 &&
|
||||
args[0].isObject() &&
|
||||
ObjectClassIs(args[0].toObject(), ESClass_Array, cx);
|
||||
args.rval().setBoolean(isArray);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user