mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
Flow analysis: remove logic to handle implicitly declared variables.
The analyzer and CFE now properly declare all variables, so we don't need this logic anymore. Change-Id: I8e0075fe78986685f4b3749b3c20d1d3610cc4af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278538 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
parent
6d0237a79b
commit
6a4a6a167d
|
@ -3457,12 +3457,14 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
|
|||
if (!_assignedVariables.isFinished) {
|
||||
_assignedVariables.finish();
|
||||
}
|
||||
AssignedVariablesNodeInfo anywhere = _assignedVariables.anywhere;
|
||||
Set<int> implicitlyDeclaredVars = {...anywhere.read, ...anywhere.written};
|
||||
implicitlyDeclaredVars.removeAll(anywhere.declared);
|
||||
for (int variableKey in implicitlyDeclaredVars) {
|
||||
_current = _current.declare(variableKey, true);
|
||||
}
|
||||
assert(() {
|
||||
AssignedVariablesNodeInfo anywhere = _assignedVariables.anywhere;
|
||||
Set<int> implicitlyDeclaredVars = {...anywhere.read, ...anywhere.written};
|
||||
implicitlyDeclaredVars.removeAll(anywhere.declared);
|
||||
assert(implicitlyDeclaredVars.isEmpty,
|
||||
'All variables should be declared somewhere');
|
||||
return true;
|
||||
}());
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue