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

Function hoistVariableDeclaration

test/fixtures/snapshot/typescript.js:109730–109743  ·  view source on GitHub ↗

* Records a hoisted variable declaration for the provided name within a lexical environment.

(name)

Source from the content-addressed store, hash-verified

109728 * Records a hoisted variable declaration for the provided name within a lexical environment.
109729 */
109730 function hoistVariableDeclaration(name) {
109731 ts.Debug.assert(state > 0 /* TransformationState.Uninitialized */, "Cannot modify the lexical environment during initialization.");
109732 ts.Debug.assert(state < 2 /* TransformationState.Completed */, "Cannot modify the lexical environment after transformation has completed.");
109733 var decl = ts.setEmitFlags(factory.createVariableDeclaration(name), 64 /* EmitFlags.NoNestedSourceMaps */);
109734 if (!lexicalEnvironmentVariableDeclarations) {
109735 lexicalEnvironmentVariableDeclarations = [decl];
109736 }
109737 else {
109738 lexicalEnvironmentVariableDeclarations.push(decl);
109739 }
109740 if (lexicalEnvironmentFlags & 1 /* LexicalEnvironmentFlags.InParameters */) {
109741 lexicalEnvironmentFlags |= 2 /* LexicalEnvironmentFlags.VariablesHoistedInParameters */;
109742 }
109743 }
109744 /**
109745 * Records a hoisted function declaration within a lexical environment.
109746 */

Calls 2

assertMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…