| 516 | } |
| 517 | |
| 518 | txSlot* fxCreateArraySpecies(txMachine* the, txNumber length) |
| 519 | { |
| 520 | txSlot* instance = fxToInstance(the, mxThis); |
| 521 | txFlag flag = 1; |
| 522 | if (fxIsArray(the, instance)) { |
| 523 | mxPushSlot(mxThis); |
| 524 | mxGetID(mxID(_constructor)); |
| 525 | if (mxIsReference(the->stack)) { |
| 526 | mxGetID(mxID(_Symbol_species)); |
| 527 | if (the->stack->kind == XS_NULL_KIND) |
| 528 | the->stack->kind = XS_UNDEFINED_KIND; |
| 529 | } |
| 530 | } |
| 531 | else |
| 532 | mxPushUndefined(); |
| 533 | if (the->stack->kind == XS_UNDEFINED_KIND) { |
| 534 | *the->stack = mxArrayConstructor; |
| 535 | flag = 0; |
| 536 | } |
| 537 | else if (mxIsReference(the->stack) && mxIsConstructor(the->stack->value.reference)) { |
| 538 | if (the->stack->value.reference != mxArrayConstructor.value.reference) |
| 539 | flag = 0; |
| 540 | } |
| 541 | else |
| 542 | mxTypeError("invalid constructor"); |
| 543 | mxNew(); |
| 544 | mxPushNumber(length); |
| 545 | mxRunCount(1); |
| 546 | mxPullSlot(mxResult); |
| 547 | return (flag) ? mxResult->value.reference->next : C_NULL; |
| 548 | } |
| 549 | |
| 550 | void fxFindThisItem(txMachine* the, txSlot* function, txNumber index, txSlot* item) |
| 551 | { |
no test coverage detected