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 summary_resynthesizer; | 5 library summary_resynthesizer; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
9 import 'package:analyzer/src/generated/element_handle.dart'; | 9 import 'package:analyzer/src/generated/element_handle.dart'; |
10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 executableElement.parameters = | 460 executableElement.parameters = |
461 serializedExecutable.parameters.map(buildParameter).toList(); | 461 serializedExecutable.parameters.map(buildParameter).toList(); |
462 if (serializedExecutable.returnType != null) { | 462 if (serializedExecutable.returnType != null) { |
463 executableElement.returnType = buildType(serializedExecutable.returnType); | 463 executableElement.returnType = buildType(serializedExecutable.returnType); |
464 } else { | 464 } else { |
465 executableElement.returnType = VoidTypeImpl.instance; | 465 executableElement.returnType = VoidTypeImpl.instance; |
466 } | 466 } |
467 executableElement.type = new FunctionTypeImpl(executableElement); | 467 executableElement.type = new FunctionTypeImpl(executableElement); |
468 executableElement.hasImplicitReturnType = | 468 executableElement.hasImplicitReturnType = |
469 serializedExecutable.hasImplicitReturnType; | 469 serializedExecutable.hasImplicitReturnType; |
| 470 executableElement.external = serializedExecutable.isExternal; |
470 } | 471 } |
471 | 472 |
472 /** | 473 /** |
473 * Resynthesize an [ExportElement], | 474 * Resynthesize an [ExportElement], |
474 */ | 475 */ |
475 ExportElement buildExport(UnlinkedExport serializedExport) { | 476 ExportElement buildExport(UnlinkedExport serializedExport) { |
476 ExportElementImpl exportElement = new ExportElementImpl(0); | 477 ExportElementImpl exportElement = new ExportElementImpl(0); |
477 String exportedLibraryUri = summaryResynthesizer.sourceFactory | 478 String exportedLibraryUri = summaryResynthesizer.sourceFactory |
478 .resolveUri(librarySource, serializedExport.uri) | 479 .resolveUri(librarySource, serializedExport.uri) |
479 .uri | 480 .uri |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 elementMap[cls.name] = cls; | 917 elementMap[cls.name] = cls; |
917 } | 918 } |
918 for (FunctionTypeAliasElement typeAlias in unit.functionTypeAliases) { | 919 for (FunctionTypeAliasElement typeAlias in unit.functionTypeAliases) { |
919 elementMap[typeAlias.name] = typeAlias; | 920 elementMap[typeAlias.name] = typeAlias; |
920 } | 921 } |
921 resummarizedElements[absoluteUri] = elementMap; | 922 resummarizedElements[absoluteUri] = elementMap; |
922 unitHolder = null; | 923 unitHolder = null; |
923 prelinkedUnit = null; | 924 prelinkedUnit = null; |
924 } | 925 } |
925 } | 926 } |
OLD | NEW |