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

Method Has

value.go:558–562  ·  view source on GitHub ↗

Has returns true if the value has the property with the given name.

(name string)

Source from the content-addressed store, hash-verified

556
557// Has returns true if the value has the property with the given name.
558func (v *Value) Has(name string) bool {
559 prop := v.ctx.NewAtom(name)
560 defer prop.Free()
561 return C.JS_HasProperty(v.ctx.ref, v.ref, prop.ref) == 1
562}
563
564// HasIdx returns true if the value has the property with the given index.
565func (v *Value) HasIdx(idx uint32) bool {

Callers 10

DeleteMethod · 0.95
TestAtomWithObjectsFunction · 0.80
unmarshalStructMethod · 0.80
TestFieldTagParsingFunction · 0.80
TestCamelCaseConversionFunction · 0.80
initializeFromObjectArgsFunction · 0.80
TestValuePropertiesFunction · 0.80
TestCallConstructorAPIFunction · 0.80

Calls 2

FreeMethod · 0.95
NewAtomMethod · 0.80

Tested by 7

TestAtomWithObjectsFunction · 0.64
TestFieldTagParsingFunction · 0.64
TestCamelCaseConversionFunction · 0.64
TestValuePropertiesFunction · 0.64
TestCallConstructorAPIFunction · 0.64