MCPcopy Create free account
hub / github.com/nodejs/node / runWithCancellationToken

Function runWithCancellationToken

test/fixtures/snapshot/typescript.js:117602–117614  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

117600 return sourceFile.parseDiagnostics;
117601 }
117602 function runWithCancellationToken(func) {
117603 try {
117604 return func();
117605 }
117606 catch (e) {
117607 if (e instanceof ts.OperationCanceledException) {
117608 // We were canceled while performing the operation. Because our type checker
117609 // might be a bad state, we need to throw it away.
117610 typeChecker = undefined;
117611 }
117612 throw e;
117613 }
117614 }
117615 function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) {
117616 return ts.concatenate(filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), getProgramDiagnostics(sourceFile));
117617 }

Calls 1

funcFunction · 0.50

Tested by

no test coverage detected