| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.mirrors_used; | 5 library dart2js.mirrors_used; |
| 6 | 6 |
| 7 import 'dart2jslib.dart' show | 7 import 'dart2jslib.dart' show |
| 8 Compiler, | 8 Compiler, |
| 9 CompilerTask, | 9 CompilerTask, |
| 10 Constant, | 10 Constant, |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 current = e; | 555 current = e; |
| 556 } | 556 } |
| 557 return current; | 557 return current; |
| 558 } | 558 } |
| 559 | 559 |
| 560 /// Helper method to lookup members in a [ScopeContainerElement]. If | 560 /// Helper method to lookup members in a [ScopeContainerElement]. If |
| 561 /// [element] is not a ScopeContainerElement, return null. | 561 /// [element] is not a ScopeContainerElement, return null. |
| 562 Element findLocalMemberIn(Element element, SourceString name) { | 562 Element findLocalMemberIn(Element element, SourceString name) { |
| 563 if (element is ScopeContainerElement) { | 563 if (element is ScopeContainerElement) { |
| 564 ScopeContainerElement scope = element; | 564 ScopeContainerElement scope = element; |
| 565 if (element.isClass()) { |
| 566 ClassElement cls = element; |
| 567 cls.ensureResolved(compiler); |
| 568 } |
| 565 return scope.localLookup(name); | 569 return scope.localLookup(name); |
| 566 } | 570 } |
| 567 return null; | 571 return null; |
| 568 } | 572 } |
| 569 | 573 |
| 570 /// Attempt to find a [Spannable] corresponding to constant. | 574 /// Attempt to find a [Spannable] corresponding to constant. |
| 571 Spannable positionOf(Constant constant) { | 575 Spannable positionOf(Constant constant) { |
| 572 Node node = constantToNodeMap[constant]; | 576 Node node = constantToNodeMap[constant]; |
| 573 if (node == null) { | 577 if (node == null) { |
| 574 // TODO(ahe): Returning [spannable] here leads to confusing error | 578 // TODO(ahe): Returning [spannable] here leads to confusing error |
| (...skipping 11 matching lines...) Expand all Loading... |
| 586 // @MirrorsUsed(targets: fisk) | 590 // @MirrorsUsed(targets: fisk) |
| 587 // ^^^^ | 591 // ^^^^ |
| 588 // | 592 // |
| 589 // Instead of saying 'fisk' should pretty print the problematic constant | 593 // Instead of saying 'fisk' should pretty print the problematic constant |
| 590 // value. | 594 // value. |
| 591 return spannable; | 595 return spannable; |
| 592 } | 596 } |
| 593 return node; | 597 return node; |
| 594 } | 598 } |
| 595 } | 599 } |
| OLD | NEW |