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

Method setLengthInt

array.go:118–127  ·  view source on GitHub ↗
(l uint32, throw bool)

Source from the content-addressed store, hash-verified

116}
117
118func (a *arrayObject) setLengthInt(l uint32, throw bool) bool {
119 if l == a.length {
120 return true
121 }
122 if !a.lengthProp.writable {
123 a.val.runtime.typeErrorResult(throw, "length is not writable")
124 return false
125 }
126 return a._setLengthInt(l, throw)
127}
128
129func (a *arrayObject) setLength(v uint32, throw bool) bool {
130 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