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

Method deleteStr

string.go:286–293  ·  view source on GitHub ↗
(name unistring.String, throw bool)

Source from the content-addressed store, hash-verified

284}
285
286func (s *stringObject) deleteStr(name unistring.String, throw bool) bool {
287 if i := strToGoIdx(name); i >= 0 && i < s.length {
288 s.val.runtime.typeErrorResult(throw, "Cannot delete property '%d' of a String", i)
289 return false
290 }
291
292 return s.baseObject.deleteStr(name, throw)
293}
294
295func (s *stringObject) deleteIdx(idx valueInt, throw bool) bool {
296 i := int64(idx)

Callers

nothing calls this directly

Calls 3

strToGoIdxFunction · 0.85
typeErrorResultMethod · 0.80
deleteStrMethod · 0.65

Tested by

no test coverage detected