@@ -2464,7 +2464,7 @@ func (c *Checker) checkParameter(node *ast.Node) {
2464
2464
// or if its FunctionBody is strict code(11.1.5).
2465
2465
c.checkGrammarModifiers(node)
2466
2466
c.checkVariableLikeDeclaration(node)
2467
- fn := getContainingFunction (node)
2467
+ fn := ast.GetContainingFunction (node)
2468
2468
var paramName string
2469
2469
if node.Name() != nil && ast.IsIdentifier(node.Name()) {
2470
2470
paramName = node.Name().Text()
@@ -5522,7 +5522,7 @@ func (c *Checker) checkVariableLikeDeclaration(node *ast.Node) {
5522
5522
}
5523
5523
if ast.IsBindingElement(node) {
5524
5524
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()) {
5526
5526
// type F = ({a: string}) => void;
5527
5527
// ^^^^^^
5528
5528
// variable renaming in function type notation is confusing,
@@ -5557,7 +5557,7 @@ func (c *Checker) checkVariableLikeDeclaration(node *ast.Node) {
5557
5557
c.checkSourceElements(name.AsBindingPattern().Elements.Nodes)
5558
5558
}
5559
5559
// 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()) {
5561
5561
c.error(node, diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation)
5562
5562
return
5563
5563
}
@@ -10508,7 +10508,7 @@ func (c *Checker) checkSpreadExpression(node *ast.Node, checkMode CheckMode) *Ty
10508
10508
10509
10509
func (c *Checker) checkYieldExpression(node *ast.Node) *Type {
10510
10510
c.checkGrammarYieldExpression(node)
10511
- fn := getContainingFunction (node)
10511
+ fn := ast.GetContainingFunction (node)
10512
10512
if fn == nil {
10513
10513
return c.anyType
10514
10514
}
@@ -22814,7 +22814,7 @@ func (c *Checker) getTypeAliasInstantiation(symbol *ast.Symbol, typeArguments []
22814
22814
22815
22815
func isLocalTypeAlias(symbol *ast.Symbol) bool {
22816
22816
declaration := core.Find(symbol.Declarations, isTypeAlias)
22817
- return declaration != nil && getContainingFunction (declaration) != nil
22817
+ return declaration != nil && ast.GetContainingFunction (declaration) != nil
22818
22818
}
22819
22819
22820
22820
func (c *Checker) getDeclaredTypeOfSymbol(symbol *ast.Symbol) *Type {
@@ -28318,7 +28318,7 @@ func (c *Checker) getContextualTypeForStaticPropertyDeclaration(declaration *ast
28318
28318
}
28319
28319
28320
28320
func (c *Checker) getContextualTypeForReturnExpression(node *ast.Node, contextFlags ContextFlags) *Type {
28321
- fn := getContainingFunction (node)
28321
+ fn := ast.GetContainingFunction (node)
28322
28322
if fn != nil {
28323
28323
contextualReturnType := c.getContextualReturnType(fn, contextFlags)
28324
28324
if contextualReturnType != nil {
@@ -28413,7 +28413,7 @@ func (c *Checker) getContextualSignatureForFunctionLikeDeclaration(node *ast.Nod
28413
28413
}
28414
28414
28415
28415
func (c *Checker) getContextualTypeForYieldOperand(node *ast.Node, contextFlags ContextFlags) *Type {
28416
- fn := getContainingFunction (node)
28416
+ fn := ast.GetContainingFunction (node)
28417
28417
if fn != nil {
28418
28418
functionFlags := getFunctionFlags(fn)
28419
28419
contextualReturnType := c.getContextualReturnType(fn, contextFlags)
0 commit comments