| 397 | } |
| 398 | |
| 399 | txIndex fxCheckArrayLength(txMachine* the, txSlot* slot) |
| 400 | { |
| 401 | if (slot->kind == XS_INTEGER_KIND) { |
| 402 | if (slot->value.integer >= 0) |
| 403 | return (txIndex)slot->value.integer; |
| 404 | } |
| 405 | else if (slot->kind == XS_NUMBER_KIND) { |
| 406 | txIndex length = (txIndex)slot->value.number; |
| 407 | txNumber check = length; |
| 408 | if (slot->value.number == check) |
| 409 | return length; |
| 410 | } |
| 411 | else { |
| 412 | txUnsigned length; |
| 413 | txNumber check; |
| 414 | mxPushSlot(slot); |
| 415 | length = fxToUnsigned(the, the->stack); |
| 416 | mxPop(); |
| 417 | mxPushSlot(slot); |
| 418 | check = fxToNumber(the, the->stack); |
| 419 | mxPop(); |
| 420 | if (length == check) |
| 421 | return length; |
| 422 | } |
| 423 | mxRangeError("invalid length"); |
| 424 | return 0; |
| 425 | } |
| 426 | |
| 427 | int fxCompareArrayItem(txMachine* the, txSlot* function, txSlot* array, txInteger i) |
| 428 | { |
no test coverage detected