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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart

Issue 2679373003: Compute also constant dependencies reference in method bodies. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'package:analyzer/context/declared_variables.dart'; 5 import 'package:analyzer/context/declared_variables.dart';
6 import 'package:analyzer/dart/ast/ast.dart'; 6 import 'package:analyzer/dart/ast/ast.dart';
7 import 'package:analyzer/dart/ast/token.dart'; 7 import 'package:analyzer/dart/ast/token.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/error/error.dart'; 9 import 'package:analyzer/error/error.dart';
10 import 'package:analyzer/error/listener.dart'; 10 import 'package:analyzer/error/listener.dart';
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 _libraryElement, source, _typeProvider, errorListener)); 455 _libraryElement, source, _typeProvider, errorListener));
456 456
457 // 457 //
458 // Find constants to compute. 458 // Find constants to compute.
459 // 459 //
460 { 460 {
461 ConstantFinder constantFinder = new ConstantFinder(); 461 ConstantFinder constantFinder = new ConstantFinder();
462 unit.accept(constantFinder); 462 unit.accept(constantFinder);
463 _constants.addAll(constantFinder.constantsToCompute); 463 _constants.addAll(constantFinder.constantsToCompute);
464 } 464 }
465
466 //
467 // Find constant dependencies to compute.
468 //
469 {
470 var finder = new ConstantExpressionsDependenciesFinder();
471 unit.accept(finder);
472 _constants.addAll(finder.dependencies);
473 }
465 } 474 }
466 475
467 /** 476 /**
468 * Return the result of resolve the given [uriContent], reporting errors 477 * Return the result of resolve the given [uriContent], reporting errors
469 * against the [uriLiteral]. 478 * against the [uriLiteral].
470 */ 479 */
471 Source _resolveUri(FileState file, bool isImport, StringLiteral uriLiteral, 480 Source _resolveUri(FileState file, bool isImport, StringLiteral uriLiteral,
472 String uriContent) { 481 String uriContent) {
473 UriValidationCode code = 482 UriValidationCode code =
474 UriBasedDirectiveImpl.validateUri(isImport, uriLiteral, uriContent); 483 UriBasedDirectiveImpl.validateUri(isImport, uriLiteral, uriContent);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 } 686 }
678 687
679 /** 688 /**
680 * Either the name or the source associated with a part-of directive. 689 * Either the name or the source associated with a part-of directive.
681 */ 690 */
682 class _NameOrSource { 691 class _NameOrSource {
683 final String name; 692 final String name;
684 final Source source; 693 final Source source;
685 _NameOrSource(this.name, this.source); 694 _NameOrSource(this.name, this.source);
686 } 695 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698