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

Method getOwnPropIdx

string.go:188–202  ·  view source on GitHub ↗
(idx valueInt)

Source from the content-addressed store, hash-verified

186}
187
188func (s *stringObject) getOwnPropIdx(idx valueInt) Value {
189 i := int64(idx)
190 if i >= 0 {
191 if i < int64(s.length) {
192 val := s._getIdx(int(i))
193 return &valueProperty{
194 value: val,
195 enumerable: true,
196 }
197 }
198 return nil
199 }
200
201 return s.baseObject.getOwnPropStr(idx.string())
202}
203
204func (s *stringObject) _getIdx(idx int) Value {
205 return s.value.Substring(idx, idx+1)

Callers 1

setForeignIdxMethod · 0.95

Calls 3

_getIdxMethod · 0.95
getOwnPropStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected