(idx uint32, desc PropertyDescriptor, throw bool)
| 420 | } |
| 421 | |
| 422 | func (a *arrayObject) _defineIdxProperty(idx uint32, desc PropertyDescriptor, throw bool) bool { |
| 423 | var existing Value |
| 424 | if idx < uint32(len(a.values)) { |
| 425 | existing = a.values[idx] |
| 426 | } |
| 427 | prop, ok := a.baseObject._defineOwnProperty(unistring.String(strconv.FormatUint(uint64(idx), 10)), existing, desc, throw) |
| 428 | if ok { |
| 429 | if idx >= a.length { |
| 430 | if !a.setLengthInt(idx+1, throw) { |
| 431 | return false |
| 432 | } |
| 433 | } |
| 434 | if a.expand(idx) { |
| 435 | a.values[idx] = prop |
| 436 | a.objCount++ |
| 437 | if _, ok := prop.(*valueProperty); ok { |
| 438 | a.propValueCount++ |
| 439 | } |
| 440 | } else { |
| 441 | a.val.self.(*sparseArrayObject).add(idx, prop) |
| 442 | } |
| 443 | } |
| 444 | return ok |
| 445 | } |
| 446 | |
| 447 | func (a *arrayObject) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool { |
| 448 | if idx := strToArrayIdx(name); idx != math.MaxUint32 { |
no test coverage detected