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

Method getOwnPropStr

array.go:156–168  ·  view source on GitHub ↗
(name unistring.String)

Source from the content-addressed store, hash-verified

154}
155
156func (a *arrayObject) getOwnPropStr(name unistring.String) Value {
157 if len(a.values) > 0 {
158 if i := strToArrayIdx(name); i != math.MaxUint32 {
159 if i < uint32(len(a.values)) {
160 return a.values[i]
161 }
162 }
163 }
164 if name == "length" {
165 return a.getLengthProp()
166 }
167 return a.baseObject.getOwnPropStr(name)
168}
169
170func (a *arrayObject) getOwnPropIdx(idx valueInt) Value {
171 if i := toIdx(idx); i != math.MaxUint32 {

Callers 2

getStrMethod · 0.95
setForeignStrMethod · 0.95

Calls 3

getLengthPropMethod · 0.95
strToArrayIdxFunction · 0.85
getOwnPropStrMethod · 0.65

Tested by

no test coverage detected