| 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 current = e; | 552 current = e; |
| 553 } | 553 } |
| 554 return current; | 554 return current; |
| 555 } | 555 } |
| 556 | 556 |
| 557 /// Helper method to lookup members in a [ScopeContainerElement]. If | 557 /// Helper method to lookup members in a [ScopeContainerElement]. If |
| 558 /// [element] is not a ScopeContainerElement, return null. | 558 /// [element] is not a ScopeContainerElement, return null. |
| 559 Element findLocalMemberIn(Element element, SourceString name) { | 559 Element findLocalMemberIn(Element element, SourceString name) { |
| 560 if (element is ScopeContainerElement) { | 560 if (element is ScopeContainerElement) { |
| 561 ScopeContainerElement scope = element; | 561 ScopeContainerElement scope = element; |
| 562 if (element.isClass()) { |
| 563 ClassElement cls = element; |
| 564 cls.ensureResolved(compiler); |
| 565 } |
| 562 return scope.localLookup(name); | 566 return scope.localLookup(name); |
| 563 } | 567 } |
| 564 return null; | 568 return null; |
| 565 } | 569 } |
| 566 | 570 |
| 567 /// Attempt to find a [Spannable] corresponding to constant. | 571 /// Attempt to find a [Spannable] corresponding to constant. |
| 568 Spannable positionOf(Constant constant) { | 572 Spannable positionOf(Constant constant) { |
| 569 Node node = constantToNodeMap[constant]; | 573 Node node = constantToNodeMap[constant]; |
| 570 if (node == null) { | 574 if (node == null) { |
| 571 // TODO(ahe): Returning [spannable] here leads to confusing error | 575 // TODO(ahe): Returning [spannable] here leads to confusing error |
| (...skipping 11 matching lines...) Expand all Loading... |
| 583 // @MirrorsUsed(targets: fisk) | 587 // @MirrorsUsed(targets: fisk) |
| 584 // ^^^^ | 588 // ^^^^ |
| 585 // | 589 // |
| 586 // Instead of saying 'fisk' should pretty print the problematic constant | 590 // Instead of saying 'fisk' should pretty print the problematic constant |
| 587 // value. | 591 // value. |
| 588 return spannable; | 592 return spannable; |
| 589 } | 593 } |
| 590 return node; | 594 return node; |
| 591 } | 595 } |
| 592 } | 596 } |
| OLD | NEW |