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

Method add

array_sparse.go:142–150  ·  view source on GitHub ↗
(idx uint32, val Value)

Source from the content-addressed store, hash-verified

140}
141
142func (a *sparseArrayObject) add(idx uint32, val Value) {
143 i := a.findIdx(idx)
144 a.items = append(a.items, sparseArrayItem{})
145 copy(a.items[i+1:], a.items[i:])
146 a.items[i] = sparseArrayItem{
147 idx: idx,
148 value: val,
149 }
150}
151
152func (a *sparseArrayObject) _setOwnIdx(idx uint32, val Value, throw bool) bool {
153 var prop Value

Callers

nothing calls this directly

Calls 1

findIdxMethod · 0.95

Tested by

no test coverage detected