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

Method getOwnPropStr

object_dynamic.go:598–609  ·  view source on GitHub ↗
(u unistring.String)

Source from the content-addressed store, hash-verified

596}
597
598func (a *dynamicArray) getOwnPropStr(u unistring.String) Value {
599 if u == "length" {
600 return &valueProperty{
601 value: intToValue(int64(a.a.Len())),
602 writable: true,
603 }
604 }
605 if idx, ok := strToInt(u); ok {
606 return a.a.Get(idx)
607 }
608 return nil
609}
610
611func (a *dynamicArray) getOwnPropIdx(v valueInt) Value {
612 return a.a.Get(toIntStrict(int64(v)))

Callers

nothing calls this directly

Calls 4

intToValueFunction · 0.85
strToIntFunction · 0.85
LenMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected