MCPcopy Create free account
hub / github.com/microsoft/typescript-go / MergeEnvironment

Method MergeEnvironment

internal/printer/emitcontext.go:255–258  ·  view source on GitHub ↗

Merges declarations produced by c.EndVariableEnvironment() or c.EndLexicalEnvironment() into a slice of statements

(statements []*ast.Statement, declarations []*ast.Statement)

Source from the content-addressed store, hash-verified

253
254// Merges declarations produced by c.EndVariableEnvironment() or c.EndLexicalEnvironment() into a slice of statements
255func (c *EmitContext) MergeEnvironment(statements []*ast.Statement, declarations []*ast.Statement) []*ast.Statement {
256 result, _ := c.mergeEnvironment(statements, declarations)
257 return result
258}
259
260func (c *EmitContext) mergeEnvironment(statements []*ast.Statement, declarations []*ast.Statement) ([]*ast.Statement, bool) {
261 if len(declarations) == 0 {

Callers 2

VisitFunctionBodyMethod · 0.95
transformClassLikeMethod · 0.80

Calls 1

mergeEnvironmentMethod · 0.95

Tested by

no test coverage detected