| 713 | } |
| 714 | |
| 715 | void fxFunctionNodeHoist(void* it, void* param) |
| 716 | { |
| 717 | txFunctionNode* self = it; |
| 718 | txHoister* hoister = param; |
| 719 | txScope* functionScope = hoister->functionScope; |
| 720 | txScope* bodyScope = hoister->bodyScope; |
| 721 | hoister->functionScope = self->scope = fxScopeNew(param, it, XS_TOKEN_FUNCTION); |
| 722 | hoister->bodyScope = C_NULL; |
| 723 | if (self->symbol) { |
| 724 | txDefineNode* node = fxDefineNodeNew(hoister->parser, XS_TOKEN_CONST, self->symbol); |
| 725 | node->initializer = fxValueNodeNew(hoister->parser, XS_TOKEN_CURRENT); |
| 726 | fxScopeAddDeclareNode(hoister->functionScope, (txDeclareNode*)node); |
| 727 | fxScopeAddDefineNode(hoister->functionScope, node); |
| 728 | } |
| 729 | fxNodeDispatchHoist(self->params, param); |
| 730 | if ((self->flags & (mxArgumentsFlag | mxEvalFlag)) && !(self->flags & mxArrowFlag)) { |
| 731 | txDeclareNode* declaration = fxDeclareNodeNew(hoister->parser, XS_TOKEN_VAR, hoister->parser->argumentsSymbol); |
| 732 | fxScopeAddDeclareNode(hoister->functionScope, declaration); |
| 733 | } |
| 734 | fxNodeDispatchHoist(self->body, param); |
| 735 | fxScopeHoisted(self->scope, param); |
| 736 | hoister->bodyScope = bodyScope; |
| 737 | hoister->functionScope = functionScope; |
| 738 | } |
| 739 | |
| 740 | txHostNode* fxHostNodeClone(txParser* parser, txHostNode* self) |
| 741 | { |
nothing calls this directly
no test coverage detected