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

Method getIdx

array.go:137–154  ·  view source on GitHub ↗
(idx valueInt, receiver Value)

Source from the content-addressed store, hash-verified

135}
136
137func (a *arrayObject) getIdx(idx valueInt, receiver Value) Value {
138 prop := a.getOwnPropIdx(idx)
139 if prop == nil {
140 if a.prototype != nil {
141 if receiver == nil {
142 return a.prototype.self.getIdx(idx, a.val)
143 }
144 return a.prototype.self.getIdx(idx, receiver)
145 }
146 }
147 if prop, ok := prop.(*valueProperty); ok {
148 if receiver == nil {
149 return prop.get(a.val)
150 }
151 return prop.get(receiver)
152 }
153 return prop
154}
155
156func (a *arrayObject) getOwnPropStr(name unistring.String) Value {
157 if len(a.values) > 0 {

Callers 1

exportMethod · 0.95

Calls 3

getOwnPropIdxMethod · 0.95
getIdxMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected