| 337 | } |
| 338 | |
| 339 | void fx_AggregateError(txMachine* the) |
| 340 | { |
| 341 | txSlot* stack = the->stack; |
| 342 | txSlot* property = fx_Error_aux(the, XS_AGGREGATE_ERROR, 1); |
| 343 | txSlot* array; |
| 344 | txSlot** address; |
| 345 | txIndex length = 0; |
| 346 | txSlot* iterator; |
| 347 | txSlot* next; |
| 348 | txSlot* value; |
| 349 | txSlot* slot; |
| 350 | |
| 351 | mxPush(mxArrayPrototype); |
| 352 | array = fxNewArrayInstance(the); |
| 353 | fxNextSlotProperty(the, property, the->stack, mxID(_errors), XS_DONT_ENUM_FLAG); |
| 354 | address = &array->next->next; |
| 355 | mxTemporary(iterator); |
| 356 | mxTemporary(next); |
| 357 | fxGetIterator(the, mxArgv(0), iterator, next, 0); |
| 358 | mxTemporary(value); |
| 359 | while (fxIteratorNext(the, iterator, next, value)) { |
| 360 | mxTry(the) { |
| 361 | *address = slot = fxNewSlot(the); |
| 362 | slot->kind = value->kind; |
| 363 | slot->value = value->value; |
| 364 | address = &slot->next; |
| 365 | length++; |
| 366 | } |
| 367 | mxCatch(the) { |
| 368 | fxIteratorReturn(the, iterator, 1); |
| 369 | fxJump(the); |
| 370 | } |
| 371 | } |
| 372 | array->next->value.array.length = length; |
| 373 | fxCacheArray(the, array); |
| 374 | |
| 375 | the->stack = stack; |
| 376 | } |
| 377 | |
| 378 | void fx_EvalError(txMachine* the) |
| 379 | { |
nothing calls this directly
no test coverage detected