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

Function hoistFunctionDeclaration

test/fixtures/snapshot/typescript.js:109747–109757  ·  view source on GitHub ↗

* Records a hoisted function declaration within a lexical environment.

(func)

Source from the content-addressed store, hash-verified

109745 * Records a hoisted function declaration within a lexical environment.
109746 */
109747 function hoistFunctionDeclaration(func) {
109748 ts.Debug.assert(state > 0 /* TransformationState.Uninitialized */, "Cannot modify the lexical environment during initialization.");
109749 ts.Debug.assert(state < 2 /* TransformationState.Completed */, "Cannot modify the lexical environment after transformation has completed.");
109750 ts.setEmitFlags(func, 1048576 /* EmitFlags.CustomPrologue */);
109751 if (!lexicalEnvironmentFunctionDeclarations) {
109752 lexicalEnvironmentFunctionDeclarations = [func];
109753 }
109754 else {
109755 lexicalEnvironmentFunctionDeclarations.push(func);
109756 }
109757 }
109758 /**
109759 * Adds an initialization statement to the top of the lexical environment.
109760 */

Callers 1

visitFunctionDeclarationFunction · 0.85

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…