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

Function createForOfBindingStatement

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

Source from the content-addressed store, hash-verified

29692 ts.createExpressionForJsxFragment = createExpressionForJsxFragment;
29693 // Utilities
29694 function createForOfBindingStatement(factory, node, boundValue) {
29695 if (ts.isVariableDeclarationList(node)) {
29696 var firstDeclaration = ts.first(node.declarations);
29697 var updatedDeclaration = factory.updateVariableDeclaration(firstDeclaration, firstDeclaration.name,
29698 /*exclamationToken*/ undefined,
29699 /*type*/ undefined, boundValue);
29700 return ts.setTextRange(factory.createVariableStatement(
29701 /*modifiers*/ undefined, factory.updateVariableDeclarationList(node, [updatedDeclaration])),
29702 /*location*/ node);
29703 }
29704 else {
29705 var updatedExpression = ts.setTextRange(factory.createAssignment(node, boundValue), /*location*/ node);
29706 return ts.setTextRange(factory.createExpressionStatement(updatedExpression), /*location*/ node);
29707 }
29708 }
29709 ts.createForOfBindingStatement = createForOfBindingStatement;
29710 function insertLeadingStatement(factory, dest, source) {
29711 if (ts.isBlock(dest)) {

Callers

nothing calls this directly

Calls 1

firstMethod · 0.45

Tested by

no test coverage detected