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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 encoder.setUri( | 286 encoder.setUri( |
287 Key.CANONICAL_URI, element.canonicalUri, element.canonicalUri); | 287 Key.CANONICAL_URI, element.canonicalUri, element.canonicalUri); |
288 encoder.setString(Key.LIBRARY_NAME, element.libraryName); | 288 encoder.setString(Key.LIBRARY_NAME, element.libraryName); |
289 SerializerUtil.serializeMembers(getMembers(element), encoder); | 289 SerializerUtil.serializeMembers(getMembers(element), encoder); |
290 encoder.setElement(Key.COMPILATION_UNIT, element.entryCompilationUnit); | 290 encoder.setElement(Key.COMPILATION_UNIT, element.entryCompilationUnit); |
291 encoder.setElements(Key.COMPILATION_UNITS, getCompilationUnits(element)); | 291 encoder.setElements(Key.COMPILATION_UNITS, getCompilationUnits(element)); |
292 encoder.setElements(Key.IMPORTS, getImports(element)); | 292 encoder.setElements(Key.IMPORTS, getImports(element)); |
293 encoder.setElements(Key.EXPORTS, element.exports); | 293 encoder.setElements(Key.EXPORTS, element.exports); |
294 | 294 |
295 encoder.setElements(Key.IMPORT_SCOPE, getImportedElements(element)); | 295 encoder.setElements(Key.IMPORT_SCOPE, getImportedElements(element)); |
296 | |
297 encoder.setElements(Key.EXPORT_SCOPE, getExportedElements(element)); | 296 encoder.setElements(Key.EXPORT_SCOPE, getExportedElements(element)); |
298 } | 297 } |
299 } | 298 } |
300 | 299 |
301 class CompilationUnitSerializer implements ElementSerializer { | 300 class CompilationUnitSerializer implements ElementSerializer { |
302 const CompilationUnitSerializer(); | 301 const CompilationUnitSerializer(); |
303 | 302 |
304 SerializedElementKind getSerializedKind(Element element) { | 303 SerializedElementKind getSerializedKind(Element element) { |
305 if (element.isCompilationUnit) { | 304 if (element.isCompilationUnit) { |
306 return SerializedElementKind.COMPILATION_UNIT; | 305 return SerializedElementKind.COMPILATION_UNIT; |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 return new LocalVariableElementZ(decoder); | 841 return new LocalVariableElementZ(decoder); |
843 case SerializedElementKind.EXTERNAL_LIBRARY: | 842 case SerializedElementKind.EXTERNAL_LIBRARY: |
844 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 843 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
845 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: | 844 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: |
846 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 845 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
847 break; | 846 break; |
848 } | 847 } |
849 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 848 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
850 } | 849 } |
851 } | 850 } |
OLD | NEW |