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

Method deleteIdx

string.go:295–303  ·  view source on GitHub ↗
(idx valueInt, throw bool)

Source from the content-addressed store, hash-verified

293}
294
295func (s *stringObject) deleteIdx(idx valueInt, throw bool) bool {
296 i := int64(idx)
297 if i >= 0 && i < int64(s.length) {
298 s.val.runtime.typeErrorResult(throw, "Cannot delete property '%d' of a String", i)
299 return false
300 }
301
302 return s.baseObject.deleteStr(idx.string(), throw)
303}
304
305func (s *stringObject) hasOwnPropertyStr(name unistring.String) bool {
306 if i := strToGoIdx(name); i >= 0 && i < s.length {

Callers

nothing calls this directly

Calls 3

typeErrorResultMethod · 0.80
deleteStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected