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

Method hasStr

builtin_proxy.go:102–112  ·  view source on GitHub ↗
(target *Object, prop unistring.String)

Source from the content-addressed store, hash-verified

100}
101
102func (h *nativeProxyHandler) hasStr(target *Object, prop unistring.String) (bool, bool) {
103 if trap := h.handler.HasIdx; trap != nil {
104 if idx, ok := strToInt(prop); ok {
105 return trap(target, idx), true
106 }
107 }
108 if trap := h.handler.Has; trap != nil {
109 return trap(target, prop.String()), true
110 }
111 return false, false
112}
113
114func (h *nativeProxyHandler) hasIdx(target *Object, prop valueInt) (bool, bool) {
115 if trap := h.handler.HasIdx; trap != nil {

Callers

nothing calls this directly

Calls 2

strToIntFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected