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

Method getStr

object_dynamic.go:581–589  ·  view source on GitHub ↗
(p unistring.String, receiver Value)

Source from the content-addressed store, hash-verified

579}
580
581func (a *dynamicArray) getStr(p unistring.String, receiver Value) Value {
582 if p == "length" {
583 return intToValue(int64(a.a.Len()))
584 }
585 if idx, ok := strToInt(p); ok {
586 return a.a.Get(idx)
587 }
588 return a.getParentStr(p, receiver)
589}
590
591func (a *dynamicArray) getIdx(p valueInt, receiver Value) Value {
592 if val := a.getOwnPropIdx(p); val != nil {

Callers

nothing calls this directly

Calls 5

intToValueFunction · 0.85
strToIntFunction · 0.85
getParentStrMethod · 0.80
LenMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected