GetAtom gets a property by atom key.
(atom *Atom)
| 708 | |
| 709 | // GetAtom gets a property by atom key. |
| 710 | func (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. |
| 719 | func (v *Value) SetAtom(atom *Atom, val *Value) bool { |