@@ -2464,7 +2464,7 @@ func (c *Checker) checkParameter(node *ast.Node) {
24642464 // or if its FunctionBody is strict code(11.1.5).
24652465 c.checkGrammarModifiers(node)
24662466 c.checkVariableLikeDeclaration(node)
2467- fn := getContainingFunction (node)
2467+ fn := ast.GetContainingFunction (node)
24682468 var paramName string
24692469 if node.Name() != nil && ast.IsIdentifier(node.Name()) {
24702470 paramName = node.Name().Text()
@@ -5522,7 +5522,7 @@ func (c *Checker) checkVariableLikeDeclaration(node *ast.Node) {
55225522 }
55235523 if ast.IsBindingElement(node) {
55245524 propName := node.PropertyName()
5525- if propName != nil && ast.IsIdentifier(node.Name()) && ast.IsPartOfParameterDeclaration(node) && ast.NodeIsMissing(getContainingFunction (node).Body()) {
5525+ if propName != nil && ast.IsIdentifier(node.Name()) && ast.IsPartOfParameterDeclaration(node) && ast.NodeIsMissing(ast.GetContainingFunction (node).Body()) {
55265526 // type F = ({a: string}) => void;
55275527 // ^^^^^^
55285528 // variable renaming in function type notation is confusing,
@@ -5557,7 +5557,7 @@ func (c *Checker) checkVariableLikeDeclaration(node *ast.Node) {
55575557 c.checkSourceElements(name.AsBindingPattern().Elements.Nodes)
55585558 }
55595559 // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body
5560- if initializer != nil && ast.IsPartOfParameterDeclaration(node) && ast.NodeIsMissing(getContainingFunction (node).Body()) {
5560+ if initializer != nil && ast.IsPartOfParameterDeclaration(node) && ast.NodeIsMissing(ast.GetContainingFunction (node).Body()) {
55615561 c.error(node, diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation)
55625562 return
55635563 }
@@ -10508,7 +10508,7 @@ func (c *Checker) checkSpreadExpression(node *ast.Node, checkMode CheckMode) *Ty
1050810508
1050910509func (c *Checker) checkYieldExpression(node *ast.Node) *Type {
1051010510 c.checkGrammarYieldExpression(node)
10511- fn := getContainingFunction (node)
10511+ fn := ast.GetContainingFunction (node)
1051210512 if fn == nil {
1051310513 return c.anyType
1051410514 }
@@ -22814,7 +22814,7 @@ func (c *Checker) getTypeAliasInstantiation(symbol *ast.Symbol, typeArguments []
2281422814
2281522815func isLocalTypeAlias(symbol *ast.Symbol) bool {
2281622816 declaration := core.Find(symbol.Declarations, isTypeAlias)
22817- return declaration != nil && getContainingFunction (declaration) != nil
22817+ return declaration != nil && ast.GetContainingFunction (declaration) != nil
2281822818}
2281922819
2282022820func (c *Checker) getDeclaredTypeOfSymbol(symbol *ast.Symbol) *Type {
@@ -28318,7 +28318,7 @@ func (c *Checker) getContextualTypeForStaticPropertyDeclaration(declaration *ast
2831828318}
2831928319
2832028320func (c *Checker) getContextualTypeForReturnExpression(node *ast.Node, contextFlags ContextFlags) *Type {
28321- fn := getContainingFunction (node)
28321+ fn := ast.GetContainingFunction (node)
2832228322 if fn != nil {
2832328323 contextualReturnType := c.getContextualReturnType(fn, contextFlags)
2832428324 if contextualReturnType != nil {
@@ -28413,7 +28413,7 @@ func (c *Checker) getContextualSignatureForFunctionLikeDeclaration(node *ast.Nod
2841328413}
2841428414
2841528415func (c *Checker) getContextualTypeForYieldOperand(node *ast.Node, contextFlags ContextFlags) *Type {
28416- fn := getContainingFunction (node)
28416+ fn := ast.GetContainingFunction (node)
2841728417 if fn != nil {
2841828418 functionFlags := getFunctionFlags(fn)
2841928419 contextualReturnType := c.getContextualReturnType(fn, contextFlags)
0 commit comments