| 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.serialization.elements; | 5 library dart2js.serialization.elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 } | 720 } |
| 721 return null; | 721 return null; |
| 722 } | 722 } |
| 723 | 723 |
| 724 void serialize(PrefixElement element, ObjectEncoder encoder, | 724 void serialize(PrefixElement element, ObjectEncoder encoder, |
| 725 SerializedElementKind kind) { | 725 SerializedElementKind kind) { |
| 726 encoder.setString(Key.NAME, element.name); | 726 encoder.setString(Key.NAME, element.name); |
| 727 encoder.setElement(Key.LIBRARY, element.library); | 727 encoder.setElement(Key.LIBRARY, element.library); |
| 728 encoder.setElement(Key.COMPILATION_UNIT, element.compilationUnit); | 728 encoder.setElement(Key.COMPILATION_UNIT, element.compilationUnit); |
| 729 encoder.setBool(Key.IS_DEFERRED, element.isDeferred); | 729 encoder.setBool(Key.IS_DEFERRED, element.isDeferred); |
| 730 Set<Element> members = new Set<Element>(); |
| 731 element.forEachLocalMember(SerializerUtil.flattenElements(members)); |
| 732 encoder.setElements(Key.MEMBERS, members); |
| 730 if (element.isDeferred) { | 733 if (element.isDeferred) { |
| 731 encoder.setElement(Key.IMPORT, element.deferredImport); | 734 encoder.setElement(Key.IMPORT, element.deferredImport); |
| 732 encoder.setElement(Key.GETTER, element.loadLibrary); | 735 encoder.setElement(Key.GETTER, element.loadLibrary); |
| 733 } | 736 } |
| 734 } | 737 } |
| 735 } | 738 } |
| 736 | 739 |
| 737 class DeferredLoadLibrarySerializer implements ElementSerializer { | 740 class DeferredLoadLibrarySerializer implements ElementSerializer { |
| 738 const DeferredLoadLibrarySerializer(); | 741 const DeferredLoadLibrarySerializer(); |
| 739 | 742 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 return new WarnOnUseElementX(warning, info, enclosing, element); | 871 return new WarnOnUseElementX(warning, info, enclosing, element); |
| 869 case SerializedElementKind.EXTERNAL_LIBRARY: | 872 case SerializedElementKind.EXTERNAL_LIBRARY: |
| 870 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 873 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
| 871 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: | 874 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: |
| 872 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 875 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
| 873 break; | 876 break; |
| 874 } | 877 } |
| 875 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 878 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
| 876 } | 879 } |
| 877 } | 880 } |
| OLD | NEW |