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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 } | 497 } |
498 | 498 |
499 /** | 499 /** |
500 * Serialize annotations from the given [element]. If [element] has no | 500 * Serialize annotations from the given [element]. If [element] has no |
501 * annotations, the empty list is returned. | 501 * annotations, the empty list is returned. |
502 */ | 502 */ |
503 List<UnlinkedConstBuilder> serializeAnnotations(Element element) { | 503 List<UnlinkedConstBuilder> serializeAnnotations(Element element) { |
504 if (element.metadata.isEmpty) { | 504 if (element.metadata.isEmpty) { |
505 return const <UnlinkedConstBuilder>[]; | 505 return const <UnlinkedConstBuilder>[]; |
506 } | 506 } |
507 return element.metadata.map((ElementAnnotationImpl a) { | 507 return element.metadata.map((ElementAnnotation a) { |
508 _ConstExprSerializer serializer = | 508 _ConstExprSerializer serializer = |
509 new _ConstExprSerializer(this, element, null); | 509 new _ConstExprSerializer(this, element, null); |
510 serializer.serializeAnnotation(a.annotationAst); | 510 serializer |
| 511 .serializeAnnotation((a as ElementAnnotationImpl).annotationAst); |
511 return serializer.toBuilder(); | 512 return serializer.toBuilder(); |
512 }).toList(); | 513 }).toList(); |
513 } | 514 } |
514 | 515 |
515 /** | 516 /** |
516 * Return the index of the entry in the references table | 517 * Return the index of the entry in the references table |
517 * ([LinkedLibrary.references]) used for the "bottom" type. A new entry is | 518 * ([LinkedLibrary.references]) used for the "bottom" type. A new entry is |
518 * added to the table if necessary to satisfy the request. | 519 * added to the table if necessary to satisfy the request. |
519 */ | 520 */ |
520 int serializeBottomReference() { | 521 int serializeBottomReference() { |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 exportNames.add(new LinkedExportNameBuilder( | 1621 exportNames.add(new LinkedExportNameBuilder( |
1621 name: name, | 1622 name: name, |
1622 dependency: serializeDependency(dependentLibrary), | 1623 dependency: serializeDependency(dependentLibrary), |
1623 unit: unit, | 1624 unit: unit, |
1624 kind: kind)); | 1625 kind: kind)); |
1625 } | 1626 } |
1626 pb.exportNames = exportNames; | 1627 pb.exportNames = exportNames; |
1627 return pb; | 1628 return pb; |
1628 } | 1629 } |
1629 } | 1630 } |
OLD | NEW |