MCPcopy Index your code
hub / github.com/nodejs/node / doInsideOfContext

Function doInsideOfContext

test/fixtures/snapshot/typescript.js:31888–31906  ·  view source on GitHub ↗
(context, func)

Source from the content-addressed store, hash-verified

31886 return func();
31887 }
31888 function doInsideOfContext(context, func) {
31889 // contextFlagsToSet will contain only the context flags that
31890 // are not currently set that we need to temporarily enable.
31891 // We don't just blindly reset to the previous flags to ensure
31892 // that we do not mutate cached flags for the incremental
31893 // parser (ThisNodeHasError, ThisNodeOrAnySubNodesHasError, and
31894 // HasAggregatedChildData).
31895 var contextFlagsToSet = context & ~contextFlags;
31896 if (contextFlagsToSet) {
31897 // set the requested context flags
31898 setContextFlag(/*val*/ true, contextFlagsToSet);
31899 var result = func();
31900 // reset the context flags we just set
31901 setContextFlag(/*val*/ false, contextFlagsToSet);
31902 return result;
31903 }
31904 // no need to do anything special as we are already in all of the requested contexts
31905 return func();
31906 }
31907 function allowInAnd(func) {
31908 return doOutsideOfContext(4096 /* NodeFlags.DisallowInContext */, func);
31909 }

Callers 14

disallowInAndFunction · 0.85
doInYieldContextFunction · 0.85
doInDecoratorContextFunction · 0.85
doInAwaitContextFunction · 0.85
doInYieldAndAwaitContextFunction · 0.85
parseWithStatementFunction · 0.85
parseDeclarationFunction · 0.85
parseClassElementFunction · 0.85
parseJSDocTypeExpressionFunction · 0.85

Calls 2

setContextFlagFunction · 0.85
funcFunction · 0.50

Tested by

no test coverage detected