MCPcopy Create free account
hub / github.com/dop251/goja / setOwnStr

Method setOwnStr

object_dynamic.go:623–632  ·  view source on GitHub ↗
(p unistring.String, v Value, throw bool)

Source from the content-addressed store, hash-verified

621}
622
623func (a *dynamicArray) setOwnStr(p unistring.String, v Value, throw bool) bool {
624 if p == "length" {
625 return a._setLen(v, throw)
626 }
627 if idx, ok := strToInt(p); ok {
628 return a._setIdx(idx, v, throw)
629 }
630 typeErrorResult(throw, "Cannot set property %q on a dynamic array", p.String())
631 return false
632}
633
634func (a *dynamicArray) _setIdx(idx int, v Value, throw bool) bool {
635 if a.a.Set(idx, v) {

Callers

nothing calls this directly

Calls 5

_setLenMethod · 0.95
_setIdxMethod · 0.95
strToIntFunction · 0.85
typeErrorResultFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected