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

Method hasOwnPropertyStr

array_sparse.go:287–294  ·  view source on GitHub ↗
(name unistring.String)

Source from the content-addressed store, hash-verified

285}
286
287func (a *sparseArrayObject) hasOwnPropertyStr(name unistring.String) bool {
288 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
289 i := a.findIdx(idx)
290 return i < len(a.items) && a.items[i].idx == idx
291 } else {
292 return a.baseObject.hasOwnPropertyStr(name)
293 }
294}
295
296func (a *sparseArrayObject) hasOwnPropertyIdx(idx valueInt) bool {
297 if idx := toIdx(idx); idx != math.MaxUint32 {

Callers

nothing calls this directly

Calls 3

findIdxMethod · 0.95
strToArrayIdxFunction · 0.85
hasOwnPropertyStrMethod · 0.65

Tested by

no test coverage detected