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

Method Set

value.go:350–359  ·  view source on GitHub ↗

Set sets the value of the property with the given name.

(name string, val *Value)

Source from the content-addressed store, hash-verified

348
349// Set sets the value of the property with the given name.
350func (v *Value) Set(name string, val *Value) {
351 if !v.isAlive() || !val.belongsTo(v.ctx) {
352 return
353 }
354 var namePtr *C.char
355 if len(name) > 0 {
356 namePtr = (*C.char)(unsafe.Pointer(unsafe.StringData(name)))
357 }
358 C.SetPropertyByNameLen(v.ctx.ref, v.ref, namePtr, C.size_t(len(name)), val.ref)
359}
360
361// SetIdx sets the value of the property with the given index.
362func (v *Value) SetIdx(idx int64, val *Value) {

Callers 15

NewErrorMethod · 0.95
TestContextFunctionsFunction · 0.80
TestContextUtilitiesFunction · 0.80
TestContextAsyncFunction · 0.80
TestContextPromiseFunction · 0.80
TestContextTypedArraysFunction · 0.80
TestContextAsyncFunctionFunction · 0.80
TestAtomWithObjectsFunction · 0.80
TestAtomEdgeCasesFunction · 0.80

Calls 2

isAliveMethod · 0.95
belongsToMethod · 0.80

Tested by 15

TestContextFunctionsFunction · 0.64
TestContextUtilitiesFunction · 0.64
TestContextAsyncFunction · 0.64
TestContextPromiseFunction · 0.64
TestContextTypedArraysFunction · 0.64
TestContextAsyncFunctionFunction · 0.64
TestAtomWithObjectsFunction · 0.64
TestAtomEdgeCasesFunction · 0.64