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

Method setOwnStr

array_sparse.go:206–216  ·  view source on GitHub ↗
(name unistring.String, val Value, throw bool)

Source from the content-addressed store, hash-verified

204}
205
206func (a *sparseArrayObject) setOwnStr(name unistring.String, val Value, throw bool) bool {
207 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
208 return a._setOwnIdx(idx, val, throw)
209 } else {
210 if name == "length" {
211 return a.setLength(a.val.runtime.toLengthUint32(val), throw)
212 } else {
213 return a.baseObject.setOwnStr(name, val, throw)
214 }
215 }
216}
217
218func (a *sparseArrayObject) setOwnIdx(idx valueInt, val Value, throw bool) bool {
219 if idx := toIdx(idx); idx != math.MaxUint32 {

Callers

nothing calls this directly

Calls 5

_setOwnIdxMethod · 0.95
setLengthMethod · 0.95
strToArrayIdxFunction · 0.85
toLengthUint32Method · 0.80
setOwnStrMethod · 0.65

Tested by

no test coverage detected