MCPcopy Create free account
hub / github.com/buke/quickjs-go / IsInstanceOfConstructor

Method IsInstanceOfConstructor

value.go:1244–1247  ·  view source on GitHub ↗

============================================================================= SPECIALIZED CLASS TYPE CHECKING METHODS ============================================================================= IsInstanceOfConstructor checks if the value is an instance of a specific constructor This uses JavaScrip

(constructor *Value)

Source from the content-addressed store, hash-verified

1242// IsInstanceOfConstructor checks if the value is an instance of a specific constructor
1243// This uses JavaScript's instanceof operator semantics
1244func (v *Value) IsInstanceOfConstructor(constructor *Value) bool {
1245 return v != nil && constructor != nil && v.IsObject() && constructor.IsFunction() &&
1246 C.JS_IsInstanceOf(v.ctx.ref, v.ref, constructor.ref) == 1
1247}
1248
1249// TypedArray detection methods
1250func (v *Value) typedArrayType() (int, bool) {

Callers 1

Calls 2

IsObjectMethod · 0.95
IsFunctionMethod · 0.80

Tested by 1