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 'common/tasks.dart' show CompilerTask; | 7 import 'common/tasks.dart' show CompilerTask; |
8 import 'common.dart'; | 8 import 'common.dart'; |
9 import 'compile_time_constants.dart' show ConstantCompiler; | 9 import 'compile_time_constants.dart' show ConstantCompiler; |
10 import 'compiler.dart' show Compiler; | 10 import 'compiler.dart' show Compiler; |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 416 } |
417 | 417 |
418 /// Find the first non-implementation interface of constant. | 418 /// Find the first non-implementation interface of constant. |
419 ResolutionDartType apiTypeOf(ConstantValue constant) { | 419 ResolutionDartType apiTypeOf(ConstantValue constant) { |
420 ResolutionDartType type = constant.getType(compiler.commonElements); | 420 ResolutionDartType type = constant.getType(compiler.commonElements); |
421 LibraryElement library = type.element.library; | 421 LibraryElement library = type.element.library; |
422 if (type.isInterfaceType && library.isInternalLibrary) { | 422 if (type.isInterfaceType && library.isInternalLibrary) { |
423 ResolutionInterfaceType interface = type; | 423 ResolutionInterfaceType interface = type; |
424 ClassElement cls = type.element; | 424 ClassElement cls = type.element; |
425 cls.ensureResolved(compiler.resolution); | 425 cls.ensureResolved(compiler.resolution); |
426 for (ResolutionDartType supertype in cls.allSupertypes) { | 426 for (ResolutionInterfaceType supertype in cls.allSupertypes) { |
427 if (supertype.isInterfaceType && | 427 if (supertype.isInterfaceType && |
428 !supertype.element.library.isInternalLibrary) { | 428 !supertype.element.library.isInternalLibrary) { |
429 return interface.asInstanceOf(supertype.element); | 429 return interface.asInstanceOf(supertype.element); |
430 } | 430 } |
431 } | 431 } |
432 } | 432 } |
433 return type; | 433 return type; |
434 } | 434 } |
435 | 435 |
436 /// Convert a list of strings and types to a list of elements. Types are | 436 /// Convert a list of strings and types to a list of elements. Types are |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 // @MirrorsUsed(targets: fisk) | 566 // @MirrorsUsed(targets: fisk) |
567 // ^^^^ | 567 // ^^^^ |
568 // | 568 // |
569 // Instead of saying 'fisk' should pretty print the problematic constant | 569 // Instead of saying 'fisk' should pretty print the problematic constant |
570 // value. | 570 // value. |
571 return spannable; | 571 return spannable; |
572 } | 572 } |
573 return node; | 573 return node; |
574 } | 574 } |
575 } | 575 } |
OLD | NEW |