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

Method Get

value.go:370–379  ·  view source on GitHub ↗

Get returns the value of the property with the given name.

(name string)

Source from the content-addressed store, hash-verified

368
369// Get returns the value of the property with the given name.
370func (v *Value) Get(name string) *Value {
371 if !v.hasValidContext() {
372 return nil
373 }
374 var namePtr *C.char
375 if len(name) > 0 {
376 namePtr = (*C.char)(unsafe.Pointer(unsafe.StringData(name)))
377 }
378 return &Value{ctx: v.ctx, ref: C.GetPropertyByNameLen(v.ctx.ref, v.ref, namePtr, C.size_t(len(name)))}
379}
380
381// GetIdx returns the value of the property with the given index.
382func (v *Value) GetIdx(idx int64) *Value {

Callers 15

LenMethod · 0.95
ByteLenMethod · 0.95
ToErrorMethod · 0.95
TestContextUtilitiesFunction · 0.80
TestContextAsyncFunctionFunction · 0.80
TestDeprecatedAPIsFunction · 0.80
GlobalInstanceofMethod · 0.80
TestAtomWithObjectsFunction · 0.80
TestAtomEdgeCasesFunction · 0.80

Calls 1

hasValidContextMethod · 0.95

Tested by 15

TestContextUtilitiesFunction · 0.64
TestContextAsyncFunctionFunction · 0.64
TestDeprecatedAPIsFunction · 0.64
TestAtomWithObjectsFunction · 0.64
TestAtomEdgeCasesFunction · 0.64
ExampleFunction · 0.64
TestFieldTagParsingFunction · 0.64
TestCamelCaseConversionFunction · 0.64