| 334 | } |
| 335 | |
| 336 | txSlot* fxCheckArray(txMachine* the, txSlot* slot, txBoolean mutable) |
| 337 | { |
| 338 | txSlot* instance = fxToInstance(the, slot); |
| 339 | txSlot* array = instance->next; |
| 340 | if (array && (array->kind == XS_ARRAY_KIND) && (array->ID == XS_ARRAY_BEHAVIOR)) { |
| 341 | #if mxAliasInstance |
| 342 | if (instance->ID) { |
| 343 | txSlot* alias = the->aliasArray[instance->ID]; |
| 344 | if (alias) |
| 345 | array = alias->next; |
| 346 | else if (mutable) { |
| 347 | instance = fxAliasInstance(the, instance); |
| 348 | array = instance->next; |
| 349 | } |
| 350 | } |
| 351 | #endif |
| 352 | { |
| 353 | txSlot* address = array->value.array.address; |
| 354 | txIndex size = (address) ? (((txChunk*)(((txByte*)address) - sizeof(txChunk)))->size) / sizeof(txSlot) : 0; |
| 355 | txSlot* prototype = instance->value.instance.prototype; |
| 356 | if (array->value.array.length != size) |
| 357 | return C_NULL; |
| 358 | if (mutable && ((instance->flag & XS_DONT_PATCH_FLAG) || (array->flag & XS_DONT_SET_FLAG))) |
| 359 | return C_NULL; |
| 360 | while (prototype) { |
| 361 | txSlot* property = prototype->next; |
| 362 | while (property) { |
| 363 | if (property->flag & XS_INTERNAL_FLAG) { |
| 364 | if ((property->kind == XS_ARRAY_KIND) && (property->value.array.address != C_NULL)) |
| 365 | return C_NULL; |
| 366 | } |
| 367 | else |
| 368 | break; |
| 369 | property = property->next; |
| 370 | } |
| 371 | prototype = prototype->value.instance.prototype; |
| 372 | } |
| 373 | return array; |
| 374 | } |
| 375 | } |
| 376 | return C_NULL; |
| 377 | } |
| 378 | |
| 379 | txSlot* fxCheckArrayItems(txMachine* the, txSlot* array, txIndex from, txIndex to) |
| 380 | { |
no test coverage detected