| 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 serialization.elements; | 5 library serialization.elements; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 * Add all classes, enums, typedefs, executables, and top level variables | 331 * Add all classes, enums, typedefs, executables, and top level variables |
| 332 * from the given compilation unit [element] to the compilation unit summary. | 332 * from the given compilation unit [element] to the compilation unit summary. |
| 333 * [unitNum] indicates the ordinal position of this compilation unit in the | 333 * [unitNum] indicates the ordinal position of this compilation unit in the |
| 334 * library. | 334 * library. |
| 335 */ | 335 */ |
| 336 void addCompilationUnitElements() { | 336 void addCompilationUnitElements() { |
| 337 unlinkedReferences = <UnlinkedReferenceBuilder>[ | 337 unlinkedReferences = <UnlinkedReferenceBuilder>[ |
| 338 new UnlinkedReferenceBuilder() | 338 new UnlinkedReferenceBuilder() |
| 339 ]; | 339 ]; |
| 340 linkedReferences = <LinkedReferenceBuilder>[ | 340 linkedReferences = <LinkedReferenceBuilder>[ |
| 341 new LinkedReferenceBuilder(kind: ReferenceKind.classOrEnum) | 341 new LinkedReferenceBuilder(kind: ReferenceKind.unresolved) |
| 342 ]; | 342 ]; |
| 343 List<UnlinkedPublicNameBuilder> names = <UnlinkedPublicNameBuilder>[]; | 343 List<UnlinkedPublicNameBuilder> names = <UnlinkedPublicNameBuilder>[]; |
| 344 for (PropertyAccessorElement accessor in compilationUnit.accessors) { | 344 for (PropertyAccessorElement accessor in compilationUnit.accessors) { |
| 345 if (accessor.isPublic) { | 345 if (accessor.isPublic) { |
| 346 names.add(new UnlinkedPublicNameBuilder( | 346 names.add(new UnlinkedPublicNameBuilder( |
| 347 kind: ReferenceKind.topLevelPropertyAccessor, | 347 kind: ReferenceKind.topLevelPropertyAccessor, |
| 348 name: accessor.name, | 348 name: accessor.name, |
| 349 numTypeParameters: accessor.typeParameters.length)); | 349 numTypeParameters: accessor.typeParameters.length)); |
| 350 } | 350 } |
| 351 } | 351 } |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 exportNames.add(new LinkedExportNameBuilder( | 1659 exportNames.add(new LinkedExportNameBuilder( |
| 1660 name: name, | 1660 name: name, |
| 1661 dependency: serializeDependency(dependentLibrary), | 1661 dependency: serializeDependency(dependentLibrary), |
| 1662 unit: unit, | 1662 unit: unit, |
| 1663 kind: kind)); | 1663 kind: kind)); |
| 1664 } | 1664 } |
| 1665 pb.exportNames = exportNames; | 1665 pb.exportNames = exportNames; |
| 1666 return pb; | 1666 return pb; |
| 1667 } | 1667 } |
| 1668 } | 1668 } |
| OLD | NEW |