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

Method getIdx

object_goarray_reflect.go:105–110  ·  view source on GitHub ↗
(idx valueInt, receiver Value)

Source from the content-addressed store, hash-verified

103}
104
105func (o *objectGoArrayReflect) getIdx(idx valueInt, receiver Value) Value {
106 if idx := toIntStrict(int64(idx)); idx >= 0 && idx < o.fieldsValue.Len() {
107 return o._getIdx(idx)
108 }
109 return o.objectGoReflect.getStr(idx.string(), receiver)
110}
111
112func (o *objectGoArrayReflect) getStr(name unistring.String, receiver Value) Value {
113 var ownProp Value

Callers 1

sortGetMethod · 0.95

Calls 5

_getIdxMethod · 0.95
toIntStrictFunction · 0.85
LenMethod · 0.65
getStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected