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

Function convertForOfStatementHead

test/fixtures/snapshot/typescript.js:96931–96947  ·  view source on GitHub ↗
(node, boundValue)

Source from the content-addressed store, hash-verified

96929 return node;
96930 }
96931 function convertForOfStatementHead(node, boundValue) {
96932 var binding = ts.createForOfBindingStatement(factory, node.initializer, boundValue);
96933 var bodyLocation;
96934 var statementsLocation;
96935 var statements = [ts.visitNode(binding, visitor, ts.isStatement)];
96936 var statement = ts.visitIterationBody(node.statement, visitor, context);
96937 if (ts.isBlock(statement)) {
96938 ts.addRange(statements, statement.statements);
96939 bodyLocation = statement;
96940 statementsLocation = statement.statements;
96941 }
96942 else {
96943 statements.push(statement);
96944 }
96945 return ts.setEmitFlags(ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation),
96946 /*multiLine*/ true), bodyLocation), 48 /* EmitFlags.NoSourceMap */ | 384 /* EmitFlags.NoTokenSourceMaps */);
96947 }
96948 function createDownlevelAwait(expression) {
96949 return enclosingFunctionFlags & 1 /* FunctionFlags.Generator */
96950 ? factory.createYieldExpression(/*asteriskToken*/ undefined, emitHelpers().createAwaitHelper(expression))

Calls 6

visitBinaryExpressionFunction · 0.85
addRangeMethod · 0.80
pushMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected