Delete deletes the property with the given name.
(name string)
| 570 | |
| 571 | // Delete deletes the property with the given name. |
| 572 | func (v *Value) Delete(name string) bool { |
| 573 | if !v.Has(name) { |
| 574 | return false // Property does not exist, nothing to delete |
| 575 | } |
| 576 | prop := v.ctx.NewAtom(name) |
| 577 | defer prop.Free() |
| 578 | return C.JS_DeleteProperty(v.ctx.ref, v.ref, prop.ref, C.int(1)) == 1 |
| 579 | } |
| 580 | |
| 581 | // DeleteIdx deletes the property with the given index. |
| 582 | func (v *Value) DeleteIdx(idx uint32) bool { |