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

Method deleteStr

typedarrays.go:906–919  ·  view source on GitHub ↗
(name unistring.String, throw bool)

Source from the content-addressed store, hash-verified

904}
905
906func (a *typedArrayObject) deleteStr(name unistring.String, throw bool) bool {
907 idx, ok := strToIntNum(name)
908 if ok {
909 if a.isValidIntegerIndex(idx) {
910 a.val.runtime.typeErrorResult(throw, "Cannot delete property '%d' of %s", idx, a.val.String())
911 return false
912 }
913 return true
914 }
915 if idx == 0 {
916 return true
917 }
918 return a.baseObject.deleteStr(name, throw)
919}
920
921func (a *typedArrayObject) deleteIdx(idx valueInt, throw bool) bool {
922 if a.viewedArrayBuf.ensureNotDetached(false) && idx >= 0 && int64(idx) < int64(a.length) {

Callers

nothing calls this directly

Calls 5

isValidIntegerIndexMethod · 0.95
strToIntNumFunction · 0.85
typeErrorResultMethod · 0.80
StringMethod · 0.65
deleteStrMethod · 0.65

Tested by

no test coverage detected