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

Function hoistBindingElement

test/fixtures/snapshot/typescript.js:106389–106401  ·  view source on GitHub ↗

* Hoists the declared names of a VariableDeclaration or BindingElement. * * @param node The declaration to hoist.

(node)

Source from the content-addressed store, hash-verified

106387 * @param node The declaration to hoist.
106388 */
106389 function hoistBindingElement(node) {
106390 if (ts.isBindingPattern(node.name)) {
106391 for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) {
106392 var element = _a[_i];
106393 if (!ts.isOmittedExpression(element)) {
106394 hoistBindingElement(element);
106395 }
106396 }
106397 }
106398 else {
106399 hoistVariableDeclaration(factory.cloneNode(node.name));
106400 }
106401 }
106402 /**
106403 * Determines whether a VariableDeclarationList should be hoisted.
106404 *

Callers 2

visitVariableStatementFunction · 0.85
visitForInitializerFunction · 0.85

Calls 1

hoistVariableDeclarationFunction · 0.85

Tested by

no test coverage detected