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

Method getStr

object_goarray_reflect.go:112–125  ·  view source on GitHub ↗
(name unistring.String, receiver Value)

Source from the content-addressed store, hash-verified

110}
111
112func (o *objectGoArrayReflect) getStr(name unistring.String, receiver Value) Value {
113 var ownProp Value
114 if idx := strToGoIdx(name); idx >= 0 && idx < o.fieldsValue.Len() {
115 ownProp = o._getIdx(idx)
116 } else if name == "length" {
117 if o.fieldsValue.Kind() == reflect.Slice {
118 o.updateLen()
119 }
120 ownProp = &o.lengthProp
121 } else {
122 ownProp = o.objectGoReflect.getOwnPropStr(name)
123 }
124 return o.getStrWithOwnProp(ownProp, name, receiver)
125}
126
127func (o *objectGoArrayReflect) getOwnPropStr(name unistring.String) Value {
128 if idx := strToGoIdx(name); idx >= 0 {

Callers

nothing calls this directly

Calls 6

_getIdxMethod · 0.95
updateLenMethod · 0.95
strToGoIdxFunction · 0.85
getStrWithOwnPropMethod · 0.80
LenMethod · 0.65
getOwnPropStrMethod · 0.65

Tested by

no test coverage detected