| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import '../closure.dart'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../common_elements.dart'; | 7 import '../common_elements.dart'; |
| 8 import '../compiler.dart'; | 8 import '../compiler.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 foundClosure = true; | 651 foundClosure = true; |
| 652 } | 652 } |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 // As we do not think about closures as classes, yet, we have to make sure | 655 // As we do not think about closures as classes, yet, we have to make sure |
| 656 // their superclasses are available for reflection manually. | 656 // their superclasses are available for reflection manually. |
| 657 if (foundClosure) { | 657 if (foundClosure) { |
| 658 ClassElement cls = _helpers.closureClass; | 658 ClassElement cls = _helpers.closureClass; |
| 659 _classesNeededForReflection.add(cls); | 659 _classesNeededForReflection.add(cls); |
| 660 } | 660 } |
| 661 Set<MethodElement> closurizedMembers = worldBuilder.closurizedMembers; | 661 Set<FunctionEntity> closurizedMembers = worldBuilder.closurizedMembers; |
| 662 if (closurizedMembers.any(_membersNeededForReflection.contains)) { | 662 if (closurizedMembers.any(_membersNeededForReflection.contains)) { |
| 663 ClassElement cls = _helpers.boundClosureClass; | 663 ClassElement cls = _helpers.boundClosureClass; |
| 664 _classesNeededForReflection.add(cls); | 664 _classesNeededForReflection.add(cls); |
| 665 } | 665 } |
| 666 // Add typedefs. | 666 // Add typedefs. |
| 667 _typedefsNeededForReflection.addAll( | 667 _typedefsNeededForReflection.addAll( |
| 668 closedWorld.allTypedefs.where(isTypedefReferencedFromMirrorSystem)); | 668 closedWorld.allTypedefs.where(isTypedefReferencedFromMirrorSystem)); |
| 669 // Register all symbols of reflectable elements | 669 // Register all symbols of reflectable elements |
| 670 for (ClassElement element in _classesNeededForReflection) { | 670 for (ClassElement element in _classesNeededForReflection) { |
| 671 symbolsUsed.add(element.name); | 671 symbolsUsed.add(element.name); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 693 } | 693 } |
| 694 | 694 |
| 695 /// Called when `const Symbol(name)` is seen. | 695 /// Called when `const Symbol(name)` is seen. |
| 696 void registerConstSymbol(String name) { | 696 void registerConstSymbol(String name) { |
| 697 symbolsUsed.add(name); | 697 symbolsUsed.add(name); |
| 698 if (name.endsWith('=')) { | 698 if (name.endsWith('=')) { |
| 699 symbolsUsed.add(name.substring(0, name.length - 1)); | 699 symbolsUsed.add(name.substring(0, name.length - 1)); |
| 700 } | 700 } |
| 701 } | 701 } |
| 702 } | 702 } |
| OLD | NEW |