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

Method getStr

builtin_proxy.go:131–141  ·  view source on GitHub ↗
(target *Object, prop unistring.String, receiver Value)

Source from the content-addressed store, hash-verified

129}
130
131func (h *nativeProxyHandler) getStr(target *Object, prop unistring.String, receiver Value) (Value, bool) {
132 if trap := h.handler.GetIdx; trap != nil {
133 if idx, ok := strToInt(prop); ok {
134 return trap(target, idx, receiver), true
135 }
136 }
137 if trap := h.handler.Get; trap != nil {
138 return trap(target, prop.String(), receiver), true
139 }
140 return nil, false
141}
142
143func (h *nativeProxyHandler) getIdx(target *Object, prop valueInt, receiver Value) (Value, bool) {
144 if trap := h.handler.GetIdx; trap != nil {

Callers

nothing calls this directly

Calls 2

strToIntFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected