Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: lib/src/codegen/side_effect_analysis.dart

Issue 1554683002: Update to latest analyzer (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/codegen/reify_coercions.dart ('k') | lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/side_effect_analysis.dart
diff --git a/lib/src/codegen/side_effect_analysis.dart b/lib/src/codegen/side_effect_analysis.dart
index 3126291e200b40c3e022012314b6bb328d9c7fe0..8fa095285c06a802e9b459fb79567e8ff7c8dd2e 100644
--- a/lib/src/codegen/side_effect_analysis.dart
+++ b/lib/src/codegen/side_effect_analysis.dart
@@ -36,8 +36,9 @@ bool isStateless(Expression node, [AstNode context]) {
if (node is ThisExpression || node is SuperExpression) return true;
if (node is SimpleIdentifier) {
var e = node.staticElement;
- if (e is PropertyAccessorElement) e =
- (e as PropertyAccessorElement).variable;
+ if (e is PropertyAccessorElement) {
+ e = e.variable;
+ }
if (e is VariableElement && !e.isSynthetic) {
if (e.isFinal) return true;
if (e is LocalVariableElement || e is ParameterElement) {
@@ -77,12 +78,15 @@ class _AssignmentFinder extends RecursiveAstVisitor {
visitSimpleIdentifier(SimpleIdentifier node) {
// Ignore if qualified.
AstNode parent = node.parent;
- if (parent is PrefixedIdentifier &&
- identical(parent.identifier, node)) return;
- if (parent is PropertyAccess &&
- identical(parent.propertyName, node)) return;
- if (parent is MethodInvocation &&
- identical(parent.methodName, node)) return;
+ if (parent is PrefixedIdentifier && identical(parent.identifier, node)) {
+ return;
+ }
+ if (parent is PropertyAccess && identical(parent.propertyName, node)) {
+ return;
+ }
+ if (parent is MethodInvocation && identical(parent.methodName, node)) {
+ return;
+ }
if (parent is ConstructorName) return;
if (parent is Label) return;
« no previous file with comments | « lib/src/codegen/reify_coercions.dart ('k') | lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698