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

Function doOutsideOfContext

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

Source from the content-addressed store, hash-verified

31867 setContextFlag(val, 32768 /* NodeFlags.AwaitContext */);
31868 }
31869 function doOutsideOfContext(context, func) {
31870 // contextFlagsToClear will contain only the context flags that are
31871 // currently set that we need to temporarily clear
31872 // We don't just blindly reset to the previous flags to ensure
31873 // that we do not mutate cached flags for the incremental
31874 // parser (ThisNodeHasError, ThisNodeOrAnySubNodesHasError, and
31875 // HasAggregatedChildData).
31876 var contextFlagsToClear = context & contextFlags;
31877 if (contextFlagsToClear) {
31878 // clear the requested context flags
31879 setContextFlag(/*val*/ false, contextFlagsToClear);
31880 var result = func();
31881 // restore the context flags we just cleared
31882 setContextFlag(/*val*/ true, contextFlagsToClear);
31883 return result;
31884 }
31885 // no need to do anything special as we are not in any of the requested contexts
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.

Callers 8

allowInAndFunction · 0.85
allowConditionalTypesAndFunction · 0.85
doOutsideOfAwaitContextFunction · 0.85
parseTypeFunction · 0.85
parseArgumentExpressionFunction · 0.85
parsePropertyDeclarationFunction · 0.85

Calls 2

setContextFlagFunction · 0.85
funcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…