summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-05-19 13:35:06 +0200
committerFabrice Bellard <fabrice@bellard.org>2025-05-19 13:35:06 +0200
commitaaa9cea6a8831d1cad7ad2e6ea157f19116e20a2 (patch)
tree5877bcbb8b5b25c8b417c3dca244ec1b95e4f269
parent1021e3c7297cbe1f5e5f3ebbc6ee7a25b4095d52 (diff)
downloadquickjs-aaa9cea6a8831d1cad7ad2e6ea157f19116e20a2.tar.gz
quickjs-aaa9cea6a8831d1cad7ad2e6ea157f19116e20a2.zip
Proxy: fixed prototype comparison in setPrototypeOf() and getPrototypeOf() (#410)
-rw-r--r--quickjs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/quickjs.c b/quickjs.c
index b524353..401022e 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -46688,7 +46688,7 @@ static JSValue js_proxy_get_prototype(JSContext *ctx, JSValueConst obj)
JS_FreeValue(ctx, ret);
return JS_EXCEPTION;
}
- if (JS_VALUE_GET_OBJ(proto1) != JS_VALUE_GET_OBJ(ret)) {
+ if (!js_same_value(ctx, proto1, ret)) {
JS_FreeValue(ctx, proto1);
fail:
JS_FreeValue(ctx, ret);
@@ -46728,7 +46728,7 @@ static int js_proxy_set_prototype(JSContext *ctx, JSValueConst obj,
proto1 = JS_GetPrototype(ctx, s->target);
if (JS_IsException(proto1))
return -1;
- if (JS_VALUE_GET_OBJ(proto_val) != JS_VALUE_GET_OBJ(proto1)) {
+ if (!js_same_value(ctx, proto_val, proto1)) {
JS_FreeValue(ctx, proto1);
JS_ThrowTypeError(ctx, "proxy: inconsistent prototype");
return -1;