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

Function transformExpression

test/fixtures/snapshot/typescript.js:151608–151627  ·  view source on GitHub ↗

* @param hasContinuation Whether another `then`, `catch`, or `finally` continuation follows the continuation to which this expression belongs. * @param continuationArgName The argument name for the continuation that follows this call.

(returnContextNode, node, transformer, hasContinuation, continuationArgName)

Source from the content-addressed store, hash-verified

151606 * @param continuationArgName The argument name for the continuation that follows this call.
151607 */
151608 function transformExpression(returnContextNode, node, transformer, hasContinuation, continuationArgName) {
151609 if (isPromiseReturningCallExpression(node, transformer.checker, "then")) {
151610 return transformThen(node, ts.elementAt(node.arguments, 0), ts.elementAt(node.arguments, 1), transformer, hasContinuation, continuationArgName);
151611 }
151612 if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) {
151613 return transformCatch(node, ts.elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName);
151614 }
151615 if (isPromiseReturningCallExpression(node, transformer.checker, "finally")) {
151616 return transformFinally(node, ts.elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName);
151617 }
151618 if (ts.isPropertyAccessExpression(node)) {
151619 return transformExpression(returnContextNode, node.expression, transformer, hasContinuation, continuationArgName);
151620 }
151621 var nodeType = transformer.checker.getTypeAtLocation(node);
151622 if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) {
151623 ts.Debug.assertNode(ts.getOriginalNode(node).parent, ts.isPropertyAccessExpression);
151624 return transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName);
151625 }
151626 return silentFail();
151627 }
151628 function isNullOrUndefined(_a, node) {
151629 var checker = _a.checker;
151630 if (node.kind === 104 /* SyntaxKind.NullKeyword */)

Callers 5

_loop_14Function · 0.85
transformFinallyFunction · 0.85
transformCatchFunction · 0.85
transformThenFunction · 0.85

Calls 6

transformThenFunction · 0.85
transformCatchFunction · 0.85
transformFinallyFunction · 0.85
silentFailFunction · 0.85

Tested by

no test coverage detected