| 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 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 /** | 1303 /** |
| 1304 * If a constructor initializer expression is being serialized, the names of | 1304 * If a constructor initializer expression is being serialized, the names of |
| 1305 * the constructor parameters. Otherwise `null`. | 1305 * the constructor parameters. Otherwise `null`. |
| 1306 */ | 1306 */ |
| 1307 final Set<String> constructorParameterNames; | 1307 final Set<String> constructorParameterNames; |
| 1308 | 1308 |
| 1309 _ConstExprSerializer(this.serializer, this.context, this.executableContext, | 1309 _ConstExprSerializer(this.serializer, this.context, this.executableContext, |
| 1310 this.constructorParameterNames); | 1310 this.constructorParameterNames); |
| 1311 | 1311 |
| 1312 @override | 1312 @override |
| 1313 bool isConstructorParameterName(String name) { | 1313 bool isParameterName(String name) { |
| 1314 return constructorParameterNames?.contains(name) ?? false; | 1314 return constructorParameterNames?.contains(name) ?? false; |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 @override | 1317 @override |
| 1318 void serializeAnnotation(Annotation annotation) { | 1318 void serializeAnnotation(Annotation annotation) { |
| 1319 if (annotation.arguments == null) { | 1319 if (annotation.arguments == null) { |
| 1320 assert(annotation.constructorName == null); | 1320 assert(annotation.constructorName == null); |
| 1321 serialize(annotation.name); | 1321 serialize(annotation.name); |
| 1322 } else { | 1322 } else { |
| 1323 Identifier name = annotation.name; | 1323 Identifier name = annotation.name; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 exportNames.add(new LinkedExportNameBuilder( | 1675 exportNames.add(new LinkedExportNameBuilder( |
| 1676 name: name, | 1676 name: name, |
| 1677 dependency: serializeDependency(dependentLibrary), | 1677 dependency: serializeDependency(dependentLibrary), |
| 1678 unit: unit, | 1678 unit: unit, |
| 1679 kind: kind)); | 1679 kind: kind)); |
| 1680 } | 1680 } |
| 1681 pb.exportNames = exportNames; | 1681 pb.exportNames = exportNames; |
| 1682 return pb; | 1682 return pb; |
| 1683 } | 1683 } |
| 1684 } | 1684 } |
| OLD | NEW |