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

Method setLength

array.go:129–135  ·  view source on GitHub ↗
(v uint32, throw bool)

Source from the content-addressed store, hash-verified

127}
128
129func (a *arrayObject) setLength(v uint32, throw bool) bool {
130 if !a.lengthProp.writable {
131 a.val.runtime.typeErrorResult(throw, "length is not writable")
132 return false
133 }
134 return a._setLengthInt(v, throw)
135}
136
137func (a *arrayObject) getIdx(idx valueInt, receiver Value) Value {
138 prop := a.getOwnPropIdx(idx)

Callers 5

setOwnStrMethod · 0.95
baseObjectMethod · 0.45
baseObjectMethod · 0.45
arrayproto_popMethod · 0.45
arrayproto_shiftMethod · 0.45

Calls 2

_setLengthIntMethod · 0.95
typeErrorResultMethod · 0.80

Tested by

no test coverage detected