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

Function fxScopeHoisted

xs/sources/xsScope.c:275–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void fxScopeHoisted(txScope* self, txHoister* hoister)
276{
277 if (self->token == XS_TOKEN_BLOCK) {
278 txDeclareNode** address = &self->firstDeclareNode;
279 txDeclareNode* node;
280 txDeclareNode* last = C_NULL;
281 while ((node = *address)) {
282 if (node->description->token == XS_NO_TOKEN) {
283 self->declareNodeCount--;
284 *address = node->nextDeclareNode;
285 }
286 else {
287 address = &node->nextDeclareNode;
288 last = node;
289 }
290 }
291 self->lastDeclareNode = last;
292 }
293 else if (self->token == XS_TOKEN_PROGRAM) {
294 txDeclareNode* node = self->firstDeclareNode;
295 while (node) {
296 if ((node->description->token == XS_TOKEN_DEFINE) || (node->description->token == XS_TOKEN_VAR))
297 self->declareNodeCount--;
298 node = node->nextDeclareNode;
299 }
300 }
301 else if (self->token == XS_TOKEN_EVAL) {
302 if (!(self->flags & mxStrictFlag)) {
303 txDeclareNode* node = self->firstDeclareNode;
304 while (node) {
305 if ((node->description->token == XS_TOKEN_DEFINE) || (node->description->token == XS_TOKEN_VAR))
306 self->declareNodeCount--;
307 node = node->nextDeclareNode;
308 }
309 }
310 }
311 hoister->scope = self->scope;
312}
313
314void fxScopeLookup(txScope* self, txAccessNode* access, txBoolean closureFlag)
315{

Callers 11

fxBlockNodeHoistFunction · 0.85
fxBodyNodeHoistFunction · 0.85
fxCatchNodeHoistFunction · 0.85
fxClassNodeHoistFunction · 0.85
fxForNodeHoistFunction · 0.85
fxForInForOfNodeHoistFunction · 0.85
fxFunctionNodeHoistFunction · 0.85
fxModuleNodeHoistFunction · 0.85
fxProgramNodeHoistFunction · 0.85
fxSwitchNodeHoistFunction · 0.85
fxWithNodeHoistFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected