| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.tree_elements; | 5 library dart2js.resolution.tree_elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 final int hashCode = ++_hashCodeCounter; | 143 final int hashCode = ++_hashCodeCounter; |
| 144 static int _hashCodeCounter = 0; | 144 static int _hashCodeCounter = 0; |
| 145 | 145 |
| 146 TreeElementMapping(this.analyzedElement); | 146 TreeElementMapping(this.analyzedElement); |
| 147 | 147 |
| 148 operator []=(Node node, Element element) { | 148 operator []=(Node node, Element element) { |
| 149 // TODO(johnniwinther): Simplify this invariant to use only declarations in | 149 // TODO(johnniwinther): Simplify this invariant to use only declarations in |
| 150 // [TreeElements]. | 150 // [TreeElements]. |
| 151 assert(invariant(node, () { | 151 assert(invariant(node, () { |
| 152 if (!element.isErroneous && analyzedElement != null && element.isPatch) { | 152 if (!element.isMalformed && analyzedElement != null && element.isPatch) { |
| 153 return analyzedElement.implementationLibrary.isPatch; | 153 return analyzedElement.implementationLibrary.isPatch; |
| 154 } | 154 } |
| 155 return true; | 155 return true; |
| 156 })); | 156 })); |
| 157 // TODO(ahe): Investigate why the invariant below doesn't hold. | 157 // TODO(ahe): Investigate why the invariant below doesn't hold. |
| 158 // assert(invariant(node, | 158 // assert(invariant(node, |
| 159 // getTreeElement(node) == element || | 159 // getTreeElement(node) == element || |
| 160 // getTreeElement(node) == null, | 160 // getTreeElement(node) == null, |
| 161 // message: '${getTreeElement(node)}; $element')); | 161 // message: '${getTreeElement(node)}; $element')); |
| 162 | 162 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 } | 502 } |
| 503 | 503 |
| 504 void setCurrentTypeMask(ForIn node, TypeMask mask) { | 504 void setCurrentTypeMask(ForIn node, TypeMask mask) { |
| 505 _setTypeMask(node.inToken, mask); | 505 _setTypeMask(node.inToken, mask); |
| 506 } | 506 } |
| 507 | 507 |
| 508 TypeMask getCurrentTypeMask(ForIn node) { | 508 TypeMask getCurrentTypeMask(ForIn node) { |
| 509 return _getTypeMask(node.inToken); | 509 return _getTypeMask(node.inToken); |
| 510 } | 510 } |
| 511 } | 511 } |
| OLD | NEW |