| 481 | } |
| 482 | |
| 483 | txBoolean fxStringGetOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* descriptor) |
| 484 | { |
| 485 | if (id == mxID(_length)) { |
| 486 | descriptor->flag = XS_DONT_DELETE_FLAG | XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG; |
| 487 | descriptor->ID = id; |
| 488 | descriptor->kind = XS_INTEGER_KIND; |
| 489 | descriptor->value.integer = mxStringInstanceLength(instance); |
| 490 | return 1; |
| 491 | } |
| 492 | if (!id && (mxCacheStringInstanceLength(instance) > index)) { |
| 493 | txSlot* string = instance->next; |
| 494 | txInteger from = fxCacheUnicodeToUTF8Offset(the, string->value.key.string, index); |
| 495 | txInteger length = fxUnicodeToUTF8Offset(string->value.key.string + from, 1); |
| 496 | descriptor->value.string = fxNewChunk(the, length + 1); |
| 497 | c_memcpy(descriptor->value.string, string->value.key.string + from, length); |
| 498 | descriptor->value.string[length] = 0; |
| 499 | descriptor->kind = XS_STRING_KIND; |
| 500 | descriptor->flag = XS_DONT_DELETE_FLAG | XS_DONT_SET_FLAG; |
| 501 | return 1; |
| 502 | } |
| 503 | return fxOrdinaryGetOwnProperty(the, instance, id, index, descriptor); |
| 504 | } |
| 505 | |
| 506 | txSlot* fxStringGetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag) |
| 507 | { |
nothing calls this directly
no test coverage detected