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

Function getIsDeferredContext

test/fixtures/snapshot/typescript.js:50090–50104  ·  view source on GitHub ↗
(location, lastLocation)

Source from the content-addressed store, hash-verified

50088 return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration, typeOnlyDeclaration.kind === 275 /* SyntaxKind.ExportSpecifier */ ? ts.Diagnostics._0_was_exported_here : ts.Diagnostics._0_was_imported_here, unescapedName));
50089 }
50090 function getIsDeferredContext(location, lastLocation) {
50091 if (location.kind !== 214 /* SyntaxKind.ArrowFunction */ && location.kind !== 213 /* SyntaxKind.FunctionExpression */) {
50092 // initializers in instance property declaration of class like entities are executed in constructor and thus deferred
50093 return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) ||
50094 (location.kind === 167 /* SyntaxKind.PropertyDeclaration */ && !ts.isStatic(location))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred
50095 }
50096 if (lastLocation && lastLocation === location.name) {
50097 return false;
50098 }
50099 // generator functions and async functions are not inlined in control flow when immediately invoked
50100 if (location.asteriskToken || ts.hasSyntacticModifier(location, 256 /* ModifierFlags.Async */)) {
50101 return true;
50102 }
50103 return !ts.getImmediatelyInvokedFunctionExpression(location);
50104 }
50105 function isSelfReferenceLocation(node) {
50106 switch (node.kind) {
50107 case 256 /* SyntaxKind.FunctionDeclaration */:

Callers 1

resolveNameHelperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…