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

Method getStr

string.go:161–166  ·  view source on GitHub ↗
(name unistring.String, receiver Value)

Source from the content-addressed store, hash-verified

159}
160
161func (s *stringObject) getStr(name unistring.String, receiver Value) Value {
162 if i := strToGoIdx(name); i >= 0 && i < s.length {
163 return s._getIdx(i)
164 }
165 return s.baseObject.getStr(name, receiver)
166}
167
168func (s *stringObject) getIdx(idx valueInt, receiver Value) Value {
169 i := int(idx)

Callers

nothing calls this directly

Calls 3

_getIdxMethod · 0.95
strToGoIdxFunction · 0.85
getStrMethod · 0.65

Tested by

no test coverage detected