| 270 | } |
| 271 | |
| 272 | txSlot* fx_Error_aux(txMachine* the, txError error, txInteger i) |
| 273 | { |
| 274 | txSlot* instance; |
| 275 | txSlot* slot; |
| 276 | if (!mxHasTarget) |
| 277 | mxPushSlot(mxFunction); |
| 278 | else |
| 279 | mxPushSlot(mxTarget); |
| 280 | fxGetPrototypeFromConstructor(the, &mxErrorPrototypes(error)); |
| 281 | instance = fxNewObjectInstance(the); |
| 282 | mxPullSlot(mxResult); |
| 283 | slot = instance->next = fxNewSlot(the); |
| 284 | slot->flag = XS_INTERNAL_FLAG; |
| 285 | slot->kind = XS_ERROR_KIND; |
| 286 | slot->value.error.info = C_NULL; |
| 287 | slot->value.error.which = error; |
| 288 | if (gxDefaults.captureErrorStack) |
| 289 | gxDefaults.captureErrorStack(the, slot, the->frame->next); |
| 290 | if ((mxArgc > i) && (mxArgv(i)->kind != XS_UNDEFINED_KIND)) { |
| 291 | fxToString(the, mxArgv(i)); |
| 292 | slot = fxNextSlotProperty(the, slot, mxArgv(i), mxID(_message), XS_DONT_ENUM_FLAG); |
| 293 | } |
| 294 | i++; |
| 295 | if ((mxArgc > i) && (mxArgv(i)->kind == XS_REFERENCE_KIND)) { |
| 296 | if (mxBehaviorHasProperty(the, mxArgv(i)->value.reference, mxID(_cause), 0)) { |
| 297 | mxPushSlot(mxArgv(i)); |
| 298 | mxGetID(mxID(_cause)); |
| 299 | slot = fxNextSlotProperty(the, slot, the->stack, mxID(_cause), XS_DONT_ENUM_FLAG); |
| 300 | mxPop(); |
| 301 | } |
| 302 | } |
| 303 | return slot; |
| 304 | } |
| 305 | |
| 306 | void fx_Error_toString(txMachine* the) |
| 307 | { |
no test coverage detected