| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4980 } | 4980 } |
| 4981 } | 4981 } |
| 4982 | 4982 |
| 4983 /// Looks up [name] in [scope] and unwraps the result. | 4983 /// Looks up [name] in [scope] and unwraps the result. |
| 4984 Element lookupInScope(Compiler compiler, Node node, | 4984 Element lookupInScope(Compiler compiler, Node node, |
| 4985 Scope scope, String name) { | 4985 Scope scope, String name) { |
| 4986 return Elements.unwrap(scope.lookup(name), compiler, node); | 4986 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4987 } | 4987 } |
| 4988 | 4988 |
| 4989 TreeElements _ensureTreeElements(AnalyzableElementX element) { | 4989 TreeElements _ensureTreeElements(AnalyzableElementX element) { |
| 4990 if (element.isErroneous) return new TreeElementMapping(element); | |
| 4991 if (element._treeElements == null) { | 4990 if (element._treeElements == null) { |
| 4992 element._treeElements = new TreeElementMapping(element); | 4991 element._treeElements = new TreeElementMapping(element); |
| 4993 } | 4992 } |
| 4994 return element._treeElements; | 4993 return element._treeElements; |
| 4995 } | 4994 } |
| 4996 | 4995 |
| 4997 abstract class AnalyzableElementX implements AnalyzableElement { | 4996 abstract class AnalyzableElementX implements AnalyzableElement { |
| 4998 TreeElements _treeElements; | 4997 TreeElements _treeElements; |
| 4999 | 4998 |
| 5000 bool get hasTreeElements => _treeElements != null; | 4999 bool get hasTreeElements => _treeElements != null; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5044 } | 5043 } |
| 5045 | 5044 |
| 5046 /// The result for the resolution of the `assert` method. | 5045 /// The result for the resolution of the `assert` method. |
| 5047 class AssertResult implements ResolutionResult { | 5046 class AssertResult implements ResolutionResult { |
| 5048 const AssertResult(); | 5047 const AssertResult(); |
| 5049 | 5048 |
| 5050 Element get element => null; | 5049 Element get element => null; |
| 5051 | 5050 |
| 5052 String toString() => 'AssertResult()'; | 5051 String toString() => 'AssertResult()'; |
| 5053 } | 5052 } |
| OLD | NEW |