| 129 | } |
| 130 | |
| 131 | txSlot* fxNewFunctionInstance(txMachine* the, txID name) |
| 132 | { |
| 133 | txSlot* instance; |
| 134 | txSlot* property; |
| 135 | |
| 136 | instance = fxNewObjectInstance(the); |
| 137 | instance->flag |= XS_CAN_CALL_FLAG; |
| 138 | |
| 139 | /* CODE */ |
| 140 | property = instance->next = fxNewSlot(the); |
| 141 | property->flag = XS_INTERNAL_FLAG; |
| 142 | property->kind = mxEmptyCode.kind; |
| 143 | property->value.code.address = mxEmptyCode.value.code.address; |
| 144 | property->value.code.closures = C_NULL; |
| 145 | |
| 146 | /* HOME */ |
| 147 | property = property->next = fxNewSlot(the); |
| 148 | property->flag = XS_INTERNAL_FLAG; |
| 149 | property->kind = XS_HOME_KIND; |
| 150 | property->value.home.object = C_NULL; |
| 151 | if (the->frame && (mxFunction->kind == XS_REFERENCE_KIND) && (mxIsFunction(mxFunction->value.reference))) { |
| 152 | txSlot* slot = mxFunctionInstanceHome(mxFunction->value.reference); |
| 153 | property->value.home.module = slot->value.home.module; |
| 154 | } |
| 155 | else |
| 156 | property->value.home.module = C_NULL; |
| 157 | |
| 158 | /* LENGTH */ |
| 159 | if (gxDefaults.newFunctionLength) |
| 160 | gxDefaults.newFunctionLength(the, instance, 0); |
| 161 | |
| 162 | /* NAME */ |
| 163 | fxRenameFunction(the, instance, name, 0, XS_NO_ID, C_NULL); |
| 164 | |
| 165 | return instance; |
| 166 | } |
| 167 | |
| 168 | void fxDefaultFunctionPrototype(txMachine* the) |
| 169 | { |
no test coverage detected