Implement the method according to spec (15.2.4.6)
Change-Id: I84b943366dcb1048966d4ae2f60bcbf01c99e7ea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
if (! V.isObject())
return Value::fromBoolean(false);
- Value O = ctx->thisObject.toObject(ctx);
+ Object *O = ctx->thisObject.toObject(ctx).objectValue();
Object *proto = V.objectValue()->prototype;
- return Value::fromBoolean(proto && O.objectValue() == proto);
+ while (proto) {
+ if (O == proto)
+ return Value::fromBoolean(true);
+ proto = proto->prototype;
+ }
+ return Value::fromBoolean(false);
}
Value ObjectPrototype::method_propertyIsEnumerable(ExecutionContext *ctx)