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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1533823006: Constant instance creation dependencies also should be computed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.constant; 5 library analyzer.src.generated.constant;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 * expressions. 1234 * expressions.
1235 */ 1235 */
1236 class ConstantExpressionsDependenciesFinder extends RecursiveAstVisitor { 1236 class ConstantExpressionsDependenciesFinder extends RecursiveAstVisitor {
1237 /** 1237 /**
1238 * The constants whose values need to be computed. 1238 * The constants whose values need to be computed.
1239 */ 1239 */
1240 HashSet<ConstantEvaluationTarget> dependencies = 1240 HashSet<ConstantEvaluationTarget> dependencies =
1241 new HashSet<ConstantEvaluationTarget>(); 1241 new HashSet<ConstantEvaluationTarget>();
1242 1242
1243 @override 1243 @override
1244 void visitInstanceCreationExpression(InstanceCreationExpression node) {
1245 if (node.isConst) {
1246 _find(node);
1247 } else {
1248 super.visitInstanceCreationExpression(node);
1249 }
1250 }
1251
1252 @override
1244 void visitListLiteral(ListLiteral node) { 1253 void visitListLiteral(ListLiteral node) {
1245 if (node.constKeyword != null) { 1254 if (node.constKeyword != null) {
1246 _find(node); 1255 _find(node);
1247 } else { 1256 } else {
1248 super.visitListLiteral(node); 1257 super.visitListLiteral(node);
1249 } 1258 }
1250 } 1259 }
1251 1260
1252 @override 1261 @override
1253 void visitMapLiteral(MapLiteral node) { 1262 void visitMapLiteral(MapLiteral node) {
(...skipping 4187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5441 return BoolState.from(_element == rightElement); 5450 return BoolState.from(_element == rightElement);
5442 } else if (rightOperand is DynamicState) { 5451 } else if (rightOperand is DynamicState) {
5443 return BoolState.UNKNOWN_VALUE; 5452 return BoolState.UNKNOWN_VALUE;
5444 } 5453 }
5445 return BoolState.FALSE_STATE; 5454 return BoolState.FALSE_STATE;
5446 } 5455 }
5447 5456
5448 @override 5457 @override
5449 String toString() => _element == null ? "-unknown-" : _element.name; 5458 String toString() => _element == null ? "-unknown-" : _element.name;
5450 } 5459 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698