We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f18d564 commit ced28f8Copy full SHA for ced28f8
Engine/Helper.cs
@@ -663,7 +663,12 @@ public object VisitScriptBlock(ScriptBlockAst scriptBlockAst)
663
if (scriptBlockAst == null) return null;
664
665
VariableAnalysis previousOuter = OuterAnalysis;
666
- OuterAnalysis = Helper.Instance.InitializeVariableAnalysisHelper(scriptBlockAst, OuterAnalysis);
+
667
+ // We already run variable analysis in these cases so check
668
+ if (!(scriptBlockAst.Parent is FunctionDefinitionAst) && !(scriptBlockAst.Parent is FunctionMemberAst))
669
+ {
670
+ OuterAnalysis = Helper.Instance.InitializeVariableAnalysisHelper(scriptBlockAst, OuterAnalysis);
671
+ }
672
673
if (scriptBlockAst.DynamicParamBlock != null)
674
{
0 commit comments