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

Function fxScopeBound

xs/sources/xsScope.c:226–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void fxScopeBound(txScope* self, txBinder* binder)
227{
228 if (self->flags & mxEvalFlag) {
229 txDeclareNode* node = self->firstDeclareNode;
230 while (node) {
231 node->flags |= mxDeclareNodeClosureFlag;
232 node = node->nextDeclareNode;
233 }
234 }
235 if (self->token == XS_TOKEN_MODULE) {
236 txDeclareNode* node = self->firstDeclareNode;
237 while (node) {
238 if (!(node->flags & mxDeclareNodeDisposableFlag))
239 node->flags |= mxDeclareNodeClosureFlag | mxDeclareNodeUseClosureFlag;
240 node = node->nextDeclareNode;
241 }
242 }
243 else if (self->token == XS_TOKEN_PROGRAM) {
244 txDeclareNode* node = self->firstDeclareNode;
245 while (node) {
246 node->flags |= mxDeclareNodeClosureFlag | mxDeclareNodeUseClosureFlag;
247 node = node->nextDeclareNode;
248 }
249 }
250 binder->scopeLevel += self->closureNodeCount;
251 binder->scopeMaximum += self->closureNodeCount;
252 fxBinderPopVariables(binder, self->declareNodeCount);
253 binder->scope = self->scope;
254}
255
256void fxScopeEval(txScope* self)
257{

Callers 10

fxBlockNodeBindFunction · 0.85
fxCatchNodeBindFunction · 0.85
fxClassNodeBindFunction · 0.85
fxForNodeBindFunction · 0.85
fxForInForOfNodeBindFunction · 0.85
fxFunctionNodeBindFunction · 0.85
fxModuleNodeBindFunction · 0.85
fxProgramNodeBindFunction · 0.85
fxSwitchNodeBindFunction · 0.85
fxWithNodeBindFunction · 0.85

Calls 1

fxBinderPopVariablesFunction · 0.85

Tested by

no test coverage detected