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

Method getIdx

array_sparse.go:101–118  ·  view source on GitHub ↗
(idx valueInt, receiver Value)

Source from the content-addressed store, hash-verified

99}
100
101func (a *sparseArrayObject) getIdx(idx valueInt, receiver Value) Value {
102 prop := a.getOwnPropIdx(idx)
103 if prop == nil {
104 if a.prototype != nil {
105 if receiver == nil {
106 return a.prototype.self.getIdx(idx, a.val)
107 }
108 return a.prototype.self.getIdx(idx, receiver)
109 }
110 }
111 if prop, ok := prop.(*valueProperty); ok {
112 if receiver == nil {
113 return prop.get(a.val)
114 }
115 return prop.get(receiver)
116 }
117 return prop
118}
119
120func (a *sparseArrayObject) getLengthProp() *valueProperty {
121 a.lengthProp.value = intToValue(int64(a.length))

Callers

nothing calls this directly

Calls 3

getOwnPropIdxMethod · 0.95
getIdxMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected