| 180 | } |
| 181 | |
| 182 | txSlot* fxGetPrototypeFromConstructor(txMachine* the, txSlot* defaultPrototype) |
| 183 | { |
| 184 | txSlot* result = the->stack; |
| 185 | fxCheckCallable(the, result); |
| 186 | mxDub(); |
| 187 | mxGetID(mxID(_prototype)); |
| 188 | if (!mxIsReference(the->stack)) { |
| 189 | txSlot* instance = result->value.reference; |
| 190 | txSlot* proxy = instance->next; |
| 191 | if (proxy->kind == XS_PROXY_KIND) { |
| 192 | if (!proxy->value.proxy.handler) |
| 193 | mxTypeError("(proxy).%s: no handler", fxName(the, mxID(_prototype))); |
| 194 | if (!proxy->value.proxy.target) |
| 195 | mxTypeError("(proxy).%s: no target", fxName(the, mxID(_prototype))); |
| 196 | } |
| 197 | the->stack->kind = defaultPrototype->kind; |
| 198 | the->stack->value = defaultPrototype->value; |
| 199 | } |
| 200 | mxPullSlot(result); |
| 201 | return result->value.reference; |
| 202 | } |
| 203 | |
| 204 | #ifndef mxLink |
| 205 | txSlot* fxNewFunctionLength(txMachine* the, txSlot* instance, txNumber length) |
no test coverage detected