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

Method getIdx

string.go:168–174  ·  view source on GitHub ↗
(idx valueInt, receiver Value)

Source from the content-addressed store, hash-verified

166}
167
168func (s *stringObject) getIdx(idx valueInt, receiver Value) Value {
169 i := int(idx)
170 if i >= 0 && i < s.length {
171 return s._getIdx(i)
172 }
173 return s.baseObject.getStr(idx.string(), receiver)
174}
175
176func (s *stringObject) getOwnPropStr(name unistring.String) Value {
177 if i := strToGoIdx(name); i >= 0 && i < s.length {

Callers

nothing calls this directly

Calls 3

_getIdxMethod · 0.95
getStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected