revert instanceof use

This commit is contained in:
2025-02-18 15:03:06 -06:00
parent 7796393a3f
commit 255d82c71b
4 changed files with 18 additions and 10 deletions

View File

@@ -7581,15 +7581,9 @@ static JSValue js_object_isPrototypeOf(JSContext *ctx, JSValueConst this_val, in
/* return TRUE, FALSE or (-1) in case of exception */
int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj)
{
JSValue ret = js_object_isPrototypeOf(ctx, obj, 1, &val);
int b = JS_ToBool(ctx,ret);
JS_FreeValue(ctx,ret);
return b;
/*
JSValue method;
if (!JS_IsObject(obj))
goto fail;
if (!JS_
method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_hasInstance);
if (JS_IsException(method))
return -1;
@@ -7605,7 +7599,6 @@ int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj)
return -1;
}
return JS_OrdinaryIsInstanceOf(ctx, val, obj);
*/
}
/* return the value associated to the autoinit property or an exception */