MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxCatchNodeHoist

Function fxCatchNodeHoist

xs/sources/xsScope.c:438–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438void fxCatchNodeHoist(void* it, void* param)
439{
440 txCatchNode* self = it;
441 txHoister* hoister = param;
442 txDeclareNode* node;
443 if (self->parameter) {
444 self->scope = fxScopeNew(param, it, XS_TOKEN_BLOCK);
445 fxNodeDispatchHoist(self->parameter, param);
446 self->statementScope = fxScopeNew(param, it, XS_TOKEN_BLOCK);
447 fxNodeDispatchHoist(self->statement, param);
448 fxScopeHoisted(self->statementScope, param);
449 fxScopeHoisted(self->scope, param);
450 node = self->statementScope->firstDeclareNode;
451 while (node) {
452 if (fxScopeGetDeclareNode(self->scope, node->symbol))
453 fxReportParserError(hoister->parser, node->line, "duplicate variable %s", node->symbol->string);
454 node = node->nextDeclareNode;
455 }
456 }
457 else {
458 self->statementScope = fxScopeNew(param, it, XS_TOKEN_BLOCK);
459 fxNodeDispatchHoist(self->statement, param);
460 fxScopeHoisted(self->statementScope, param);
461 }
462}
463
464void fxClassNodeHoist(void* it, void* param)
465{

Callers

nothing calls this directly

Calls 5

fxScopeNewFunction · 0.85
fxNodeDispatchHoistFunction · 0.85
fxScopeHoistedFunction · 0.85
fxScopeGetDeclareNodeFunction · 0.85
fxReportParserErrorFunction · 0.85

Tested by

no test coverage detected