This commit is contained in:
Jarred Sumner
2022-05-04 22:14:02 -07:00
parent 6b97680224
commit 2c0c91e2d0
2 changed files with 61 additions and 4 deletions

View File

@@ -2281,6 +2281,13 @@ pub const JSValue = enum(u64) {
};
}
pub fn isInstanceOf(this: JSValue, global: *JSGlobalObject, constructor: JSValue) bool {
if (this.isEmptyOrUndefinedOrNull())
return false;
return JSC.C.JSValueIsInstanceOfConstructor(global.ref(), this.asObjectRef(), constructor.ref(), null);
}
pub fn jsType(
this: JSValue,
) JSType {