Skip to content

Commit a2ef243

Browse files
author
quoctruong
committed
Merge pull request #15 from PowerShell/quoct-uninitializedvariableforclass
Make UninitializedVariable recognize functions in classes
2 parents 1c0dfc2 + 79d5cd7 commit a2ef243

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Rules/AvoidUnitializedVariable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
4646
}
4747
}
4848

49-
IEnumerable<Ast> funcAsts = ast.FindAll(item => item is FunctionDefinitionAst, true);
49+
IEnumerable<Ast> funcAsts = ast.FindAll(item => item is FunctionDefinitionAst || item is FunctionMemberAst, true);
5050

5151
foreach (var funcAst in funcAsts)
5252
{

0 commit comments

Comments
 (0)