| 5031 | } |
| 5032 | |
| 5033 | void fxRunScript(txMachine* the, txScript* script, txSlot* _this, txSlot* _target, txSlot* closures, txSlot* object, txSlot* module) |
| 5034 | { |
| 5035 | if (script) { |
| 5036 | mxTry(the) { |
| 5037 | txSlot* instance; |
| 5038 | txSlot* property; |
| 5039 | __JUMP__.code = C_NULL; |
| 5040 | fxRemapScript(the, script); |
| 5041 | if (script->callback) { |
| 5042 | property = the->stack; |
| 5043 | /* THIS */ |
| 5044 | if (_this) |
| 5045 | mxPushSlot(_this); |
| 5046 | else |
| 5047 | mxPushUndefined(); |
| 5048 | the->stack->ID = XS_NO_ID; |
| 5049 | /* FUNCTION */ |
| 5050 | mxPush(mxFunctionPrototype); |
| 5051 | instance = fxNewFunctionInstance(the, closures ? mxID(_eval) : XS_NO_ID); |
| 5052 | instance->next->kind = XS_CALLBACK_KIND; |
| 5053 | instance->next->value.callback.address = script->callback; |
| 5054 | instance->next->value.callback.closures = C_NULL; |
| 5055 | property = mxFunctionInstanceHome(instance); |
| 5056 | property->value.home.object = object; |
| 5057 | property->value.home.module = module; |
| 5058 | /* RESULT */ |
| 5059 | mxPushUndefined(); |
| 5060 | /* FRAME */ |
| 5061 | mxPushUninitialized(); |
| 5062 | mxRunCount(0); |
| 5063 | } |
| 5064 | else { |
| 5065 | mxPushUndefined(); |
| 5066 | } |
| 5067 | mxPull(mxHosts); |
| 5068 | mxPop(); |
| 5069 | |
| 5070 | /* TARGET */ |
| 5071 | if (_target) |
| 5072 | mxPushSlot(_target); |
| 5073 | /* THIS */ |
| 5074 | if (_this) |
| 5075 | mxPushSlot(_this); |
| 5076 | else |
| 5077 | mxPushUndefined(); |
| 5078 | the->stack->ID = XS_NO_ID; |
| 5079 | /* FUNCTION */ |
| 5080 | mxPush(mxFunctionPrototype); |
| 5081 | instance = fxNewFunctionInstance(the, XS_NO_ID); |
| 5082 | instance->next->kind = XS_CODE_X_KIND; |
| 5083 | instance->next->value.code.address = script->codeBuffer; |
| 5084 | instance->next->value.code.closures = closures; |
| 5085 | property = mxFunctionInstanceHome(instance); |
| 5086 | property->ID = fxGenerateProfileID(the); |
| 5087 | property->value.home.object = object; |
| 5088 | property->value.home.module = module; |
| 5089 | /* RESULT */ |
| 5090 | mxPushUndefined(); |
no test coverage detected