JS: fixup optional chaining on CallWithNonLocalAnalyzedReturnFlow

This commit is contained in:
Esben Sparre Andreasen
2018-11-21 14:18:14 +01:00
parent 41b45352aa
commit 72c4ef4d90
3 changed files with 25 additions and 3 deletions

View File

@@ -157,6 +157,10 @@ abstract class CallWithNonLocalAnalyzedReturnFlow extends DataFlow::AnalyzedValu
override AbstractValue getAValue() {
result = getACallee().getAReturnValue()
or
// special case from the local layer (could be more precise if it is inferred that the callee is not `null`/`undefined`)
astNode instanceof OptionalChainRoot and
result = TAbstractUndefined()
}
}