* Records a hoisted variable declaration for the provided name within a lexical environment.
(name)
| 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 | */ |
no test coverage detected
searching dependent graphs…