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

Method setLengthInt

array_sparse.go:69–78  ·  view source on GitHub ↗
(l uint32, throw bool)

Source from the content-addressed store, hash-verified

67}
68
69func (a *sparseArrayObject) setLengthInt(l uint32, throw bool) bool {
70 if l == a.length {
71 return true
72 }
73 if !a.lengthProp.writable {
74 a.val.runtime.typeErrorResult(throw, "length is not writable")
75 return false
76 }
77 return a._setLengthInt(l, throw)
78}
79
80func (a *sparseArrayObject) setLength(v uint32, throw bool) bool {
81 if !a.lengthProp.writable {

Callers 2

_setOwnIdxMethod · 0.95
_defineIdxPropertyMethod · 0.95

Calls 2

_setLengthIntMethod · 0.95
typeErrorResultMethod · 0.80

Tested by

no test coverage detected