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

Function getYieldedTypeOfYieldExpression

test/fixtures/snapshot/typescript.js:77960–77967  ·  view source on GitHub ↗
(node, expressionType, sentType, isAsync)

Source from the content-addressed store, hash-verified

77958 return { yieldTypes: yieldTypes, nextTypes: nextTypes };
77959 }
77960 function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) {
77961 var errorNode = node.expression || node;
77962 // A `yield*` expression effectively yields everything that its operand yields
77963 var yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* IterationUse.AsyncYieldStar */ : 17 /* IterationUse.YieldStar */, expressionType, sentType, errorNode) : expressionType;
77964 return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken
77965 ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
77966 : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
77967 }
77968 /**
77969 * Collect the TypeFacts learned from a typeof switch with
77970 * total clauses `witnesses`, and the active clause ranging

Callers 2

checkYieldExpressionFunction · 0.85

Calls 2

getAwaitedTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…