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

Method setStr

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

Source from the content-addressed store, hash-verified

158}
159
160func (h *nativeProxyHandler) setStr(target *Object, prop unistring.String, value Value, receiver Value) (bool, bool) {
161 if trap := h.handler.SetIdx; trap != nil {
162 if idx, ok := strToInt(prop); ok {
163 return trap(target, idx, value, receiver), true
164 }
165 }
166 if trap := h.handler.Set; trap != nil {
167 return trap(target, prop.String(), value, receiver), true
168 }
169 return false, false
170}
171
172func (h *nativeProxyHandler) setIdx(target *Object, prop valueInt, value Value, receiver Value) (bool, bool) {
173 if trap := h.handler.SetIdx; trap != nil {

Callers

nothing calls this directly

Calls 2

strToIntFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected