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

Function visitForInitializer

test/fixtures/snapshot/typescript.js:106812–106827  ·  view source on GitHub ↗

* Visits the initializer of a ForStatement, ForInStatement, or ForOfStatement * * @param node The node to visit.

(node)

Source from the content-addressed store, hash-verified

106810 * @param node The node to visit.
106811 */
106812 function visitForInitializer(node) {
106813 if (shouldHoistForInitializer(node)) {
106814 var expressions = void 0;
106815 for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) {
106816 var variable = _a[_i];
106817 expressions = ts.append(expressions, transformInitializedVariable(variable, /*isExportedDeclaration*/ false));
106818 if (!variable.initializer) {
106819 hoistBindingElement(variable);
106820 }
106821 }
106822 return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression();
106823 }
106824 else {
106825 return ts.visitNode(node, discardedValueVisitor, ts.isExpression);
106826 }
106827 }
106828 /**
106829 * Visits the body of a DoStatement to hoist declarations.
106830 *

Callers 2

visitForInStatementFunction · 0.85
visitForOfStatementFunction · 0.85

Calls 4

hoistBindingElementFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…