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

Method _getIdx

object_goarray_reflect.go:90–103  ·  view source on GitHub ↗
(idx int)

Source from the content-addressed store, hash-verified

88}
89
90func (o *objectGoArrayReflect) _getIdx(idx int) Value {
91 if v := o.valueCache.get(idx); v != nil {
92 return v.esValue()
93 }
94
95 v := o.fieldsValue.Index(idx)
96
97 res, w := o.elemToValue(v)
98 if w != nil {
99 o.valueCache.put(idx, w)
100 }
101
102 return res
103}
104
105func (o *objectGoArrayReflect) getIdx(idx valueInt, receiver Value) Value {
106 if idx := toIntStrict(int64(idx)); idx >= 0 && idx < o.fieldsValue.Len() {

Callers 4

getIdxMethod · 0.95
getStrMethod · 0.95
getOwnPropStrMethod · 0.95
getOwnPropIdxMethod · 0.95

Calls 4

elemToValueMethod · 0.80
getMethod · 0.65
esValueMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected