diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-05-19 13:35:06 +0200 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-05-19 13:35:06 +0200 |
commit | aaa9cea6a8831d1cad7ad2e6ea157f19116e20a2 (patch) | |
tree | 5877bcbb8b5b25c8b417c3dca244ec1b95e4f269 | |
parent | 1021e3c7297cbe1f5e5f3ebbc6ee7a25b4095d52 (diff) | |
download | quickjs-aaa9cea6a8831d1cad7ad2e6ea157f19116e20a2.tar.gz quickjs-aaa9cea6a8831d1cad7ad2e6ea157f19116e20a2.zip |
Proxy: fixed prototype comparison in setPrototypeOf() and getPrototypeOf() (#410)
-rw-r--r-- | quickjs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |