(location *ast.Node, lastLocation *ast.Node)
| 457 | } |
| 458 | |
| 459 | func getIsDeferredContext(location *ast.Node, lastLocation *ast.Node) bool { |
| 460 | if location.Kind != ast.KindArrowFunction && location.Kind != ast.KindFunctionExpression { |
| 461 | // initializers in instance property declaration of class like entities are executed in constructor and thus deferred |
| 462 | // A name is evaluated within the enclosing scope - so it shouldn't count as deferred |
| 463 | return ast.IsTypeQueryNode(location) || |
| 464 | (ast.IsFunctionLikeDeclaration(location) || location.Kind == ast.KindPropertyDeclaration && !ast.IsStatic(location)) && |
| 465 | (lastLocation == nil || lastLocation != location.Name()) |
| 466 | } |
| 467 | if lastLocation != nil && lastLocation == location.Name() { |
| 468 | return false |
| 469 | } |
| 470 | // generator functions and async functions are not inlined in control flow when immediately invoked |
| 471 | if location.BodyData().AsteriskToken != nil || ast.HasSyntacticModifier(location, ast.ModifierFlagsAsync) { |
| 472 | return true |
| 473 | } |
| 474 | return ast.GetImmediatelyInvokedFunctionExpression(location) == nil |
| 475 | } |
| 476 | |
| 477 | func isTypeParameterSymbolDeclaredInContainer(symbol *ast.Symbol, container *ast.Node) bool { |
| 478 | for _, decl := range symbol.Declarations { |
no test coverage detected