| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.resolution; | 5 library dart2js.resolution; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 : super(measurer); | 69 : super(measurer); |
| 70 | 70 |
| 71 String get name => 'Resolver'; | 71 String get name => 'Resolver'; |
| 72 | 72 |
| 73 DiagnosticReporter get reporter => resolution.reporter; | 73 DiagnosticReporter get reporter => resolution.reporter; |
| 74 Target get target => resolution.target; | 74 Target get target => resolution.target; |
| 75 CommonElements get commonElements => resolution.commonElements; | 75 CommonElements get commonElements => resolution.commonElements; |
| 76 ParsingContext get parsingContext => resolution.parsingContext; | 76 ParsingContext get parsingContext => resolution.parsingContext; |
| 77 CompilerOptions get options => resolution.options; | 77 CompilerOptions get options => resolution.options; |
| 78 ResolutionEnqueuer get enqueuer => resolution.enqueuer; | 78 ResolutionEnqueuer get enqueuer => resolution.enqueuer; |
| 79 OpenWorld get world => enqueuer.universe; | 79 OpenWorld get world => enqueuer.worldBuilder; |
| 80 | 80 |
| 81 ResolutionImpact resolve(Element element) { | 81 ResolutionImpact resolve(Element element) { |
| 82 return measure(() { | 82 return measure(() { |
| 83 if (Elements.isMalformed(element)) { | 83 if (Elements.isMalformed(element)) { |
| 84 // TODO(johnniwinther): Add a predicate for this. | 84 // TODO(johnniwinther): Add a predicate for this. |
| 85 assert(invariant(element, element is! ErroneousElement, | 85 assert(invariant(element, element is! ErroneousElement, |
| 86 message: "Element $element expected to have parse errors.")); | 86 message: "Element $element expected to have parse errors.")); |
| 87 _ensureTreeElements(element); | 87 _ensureTreeElements(element); |
| 88 return const ResolutionImpact(); | 88 return const ResolutionImpact(); |
| 89 } | 89 } |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 TreeElements get treeElements { | 1138 TreeElements get treeElements { |
| 1139 assert(invariant(this, _treeElements != null, | 1139 assert(invariant(this, _treeElements != null, |
| 1140 message: "TreeElements have not been computed for $this.")); | 1140 message: "TreeElements have not been computed for $this.")); |
| 1141 return _treeElements; | 1141 return _treeElements; |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 void reuseElement() { | 1144 void reuseElement() { |
| 1145 _treeElements = null; | 1145 _treeElements = null; |
| 1146 } | 1146 } |
| 1147 } | 1147 } |
| OLD | NEW |