(idx uint32, throw bool)
| 391 | } |
| 392 | |
| 393 | func (a *sparseArrayObject) _deleteIdxProp(idx uint32, throw bool) bool { |
| 394 | i := a.findIdx(idx) |
| 395 | if i < len(a.items) && a.items[i].idx == idx { |
| 396 | if p, ok := a.items[i].value.(*valueProperty); ok { |
| 397 | if !p.configurable { |
| 398 | a.val.runtime.typeErrorResult(throw, "Cannot delete property '%d' of %s", idx, a.val.toString()) |
| 399 | return false |
| 400 | } |
| 401 | a.propValueCount-- |
| 402 | } |
| 403 | copy(a.items[i:], a.items[i+1:]) |
| 404 | a.items[len(a.items)-1].value = nil |
| 405 | a.items = a.items[:len(a.items)-1] |
| 406 | } |
| 407 | return true |
| 408 | } |
| 409 | |
| 410 | func (a *sparseArrayObject) deleteStr(name unistring.String, throw bool) bool { |
| 411 | if idx := strToArrayIdx(name); idx != math.MaxUint32 { |
no test coverage detected