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

Method GetAtom

value.go:710–716  ·  view source on GitHub ↗

GetAtom gets a property by atom key.

(atom *Atom)

Source from the content-addressed store, hash-verified

708
709// GetAtom gets a property by atom key.
710func (v *Value) GetAtom(atom *Atom) *Value {
711 if !v.isAlive() || atom == nil || atom.ctx == nil || atom.ctx != v.ctx || !atom.ctx.hasValidRef() {
712 return nil
713 }
714 // JS_GetProperty borrows atom; caller retains atom ownership.
715 return &Value{ctx: v.ctx, ref: C.JS_GetProperty(v.ctx.ref, v.ref, atom.ref)}
716}
717
718// SetAtom sets a property by atom key.
719func (v *Value) SetAtom(atom *Atom, val *Value) bool {

Calls 2

isAliveMethod · 0.95
hasValidRefMethod · 0.80