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

Method setLength

array_sparse.go:80–86  ·  view source on GitHub ↗
(v uint32, throw bool)

Source from the content-addressed store, hash-verified

78}
79
80func (a *sparseArrayObject) setLength(v uint32, throw bool) bool {
81 if !a.lengthProp.writable {
82 a.val.runtime.typeErrorResult(throw, "length is not writable")
83 return false
84 }
85 return a._setLengthInt(v, throw)
86}
87
88func (a *sparseArrayObject) _getIdx(idx uint32) Value {
89 i := a.findIdx(idx)

Callers 1

setOwnStrMethod · 0.95

Calls 2

_setLengthIntMethod · 0.95
typeErrorResultMethod · 0.80

Tested by

no test coverage detected