| 207 | } |
| 208 | |
| 209 | void fx_Number(txMachine* the) |
| 210 | { |
| 211 | txNumber value = 0; |
| 212 | if (mxArgc > 0) { |
| 213 | txSlot* slot = mxArgv(0); |
| 214 | if (slot->kind == XS_REFERENCE_KIND) |
| 215 | fxToPrimitive(the, slot, XS_NUMBER_HINT); |
| 216 | if ((slot->kind == XS_BIGINT_KIND) || (slot->kind == XS_BIGINT_X_KIND)) |
| 217 | value = gxTypeBigInt.toNumber(the, slot); |
| 218 | else |
| 219 | value = fxToNumber(the, slot); |
| 220 | } |
| 221 | if (!mxHasTarget) { |
| 222 | mxResult->kind = XS_NUMBER_KIND; |
| 223 | mxResult->value.number = value; |
| 224 | fx_Math_toInteger(the); |
| 225 | } |
| 226 | else { |
| 227 | txSlot* instance; |
| 228 | mxPushSlot(mxTarget); |
| 229 | fxGetPrototypeFromConstructor(the, &mxNumberPrototype); |
| 230 | instance = fxNewNumberInstance(the); |
| 231 | instance->next->value.number = value; |
| 232 | mxPullSlot(mxResult); |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | void fx_Number_isFinite(txMachine* the) |
| 237 | { |
nothing calls this directly
no test coverage detected