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

Method hasOwnPropertyIdx

array_sparse.go:296–303  ·  view source on GitHub ↗
(idx valueInt)

Source from the content-addressed store, hash-verified

294}
295
296func (a *sparseArrayObject) hasOwnPropertyIdx(idx valueInt) bool {
297 if idx := toIdx(idx); idx != math.MaxUint32 {
298 i := a.findIdx(idx)
299 return i < len(a.items) && a.items[i].idx == idx
300 }
301
302 return a.baseObject.hasOwnPropertyStr(idx.string())
303}
304
305func (a *sparseArrayObject) hasPropertyIdx(idx valueInt) bool {
306 if a.hasOwnPropertyIdx(idx) {

Callers 1

hasPropertyIdxMethod · 0.95

Calls 4

findIdxMethod · 0.95
toIdxFunction · 0.85
hasOwnPropertyStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected