Skip to content

Commit aaa9cea

Browse files
author
Fabrice Bellard
committed
Proxy: fixed prototype comparison in setPrototypeOf() and getPrototypeOf() (bellard#410)
1 parent 1021e3c commit aaa9cea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

quickjs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46688,7 +46688,7 @@ static JSValue js_proxy_get_prototype(JSContext *ctx, JSValueConst obj)
4668846688
JS_FreeValue(ctx, ret);
4668946689
return JS_EXCEPTION;
4669046690
}
46691-
if (JS_VALUE_GET_OBJ(proto1) != JS_VALUE_GET_OBJ(ret)) {
46691+
if (!js_same_value(ctx, proto1, ret)) {
4669246692
JS_FreeValue(ctx, proto1);
4669346693
fail:
4669446694
JS_FreeValue(ctx, ret);
@@ -46728,7 +46728,7 @@ static int js_proxy_set_prototype(JSContext *ctx, JSValueConst obj,
4672846728
proto1 = JS_GetPrototype(ctx, s->target);
4672946729
if (JS_IsException(proto1))
4673046730
return -1;
46731-
if (JS_VALUE_GET_OBJ(proto_val) != JS_VALUE_GET_OBJ(proto1)) {
46731+
if (!js_same_value(ctx, proto_val, proto1)) {
4673246732
JS_FreeValue(ctx, proto1);
4673346733
JS_ThrowTypeError(ctx, "proxy: inconsistent prototype");
4673446734
return -1;

0 commit comments

Comments
 (0)