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

Method SetIdx

value.go:362–367  ·  view source on GitHub ↗

SetIdx sets the value of the property with the given index.

(idx int64, val *Value)

Source from the content-addressed store, hash-verified

360
361// SetIdx sets the value of the property with the given index.
362func (v *Value) SetIdx(idx int64, val *Value) {
363 if !v.isAlive() || !val.belongsTo(v.ctx) {
364 return
365 }
366 C.JS_SetPropertyUint32(v.ctx.ref, v.ref, C.uint32_t(idx), val.ref)
367}
368
369// Get returns the value of the property with the given name.
370func (v *Value) Get(name string) *Value {

Calls 2

isAliveMethod · 0.95
belongsToMethod · 0.80