| 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 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (serializedLibrary == null) { | 212 if (serializedLibrary == null) { |
| 213 LibraryElementImpl libraryElement = | 213 LibraryElementImpl libraryElement = |
| 214 new LibraryElementImpl(context, '', -1, 0); | 214 new LibraryElementImpl(context, '', -1, 0); |
| 215 libraryElement.isSynthetic = true; | 215 libraryElement.isSynthetic = true; |
| 216 CompilationUnitElementImpl unitElement = | 216 CompilationUnitElementImpl unitElement = |
| 217 new CompilationUnitElementImpl(librarySource.shortName); | 217 new CompilationUnitElementImpl(librarySource.shortName); |
| 218 libraryElement.definingCompilationUnit = unitElement; | 218 libraryElement.definingCompilationUnit = unitElement; |
| 219 unitElement.source = librarySource; | 219 unitElement.source = librarySource; |
| 220 unitElement.librarySource = librarySource; | 220 unitElement.librarySource = librarySource; |
| 221 libraryElement.createLoadLibraryFunction(typeProvider); | 221 libraryElement.createLoadLibraryFunction(typeProvider); |
| 222 libraryElement.publicNamespace = new Namespace({}); |
| 223 libraryElement.exportNamespace = new Namespace({}); |
| 222 return libraryElement; | 224 return libraryElement; |
| 223 } | 225 } |
| 224 UnlinkedUnit unlinkedSummary = _getUnlinkedSummaryOrNull(uri); | 226 UnlinkedUnit unlinkedSummary = _getUnlinkedSummaryOrNull(uri); |
| 225 if (unlinkedSummary == null) { | 227 if (unlinkedSummary == null) { |
| 226 throw new StateError('Unable to find unlinked summary: $uri'); | 228 throw new StateError('Unable to find unlinked summary: $uri'); |
| 227 } | 229 } |
| 228 List<UnlinkedUnit> serializedUnits = <UnlinkedUnit>[unlinkedSummary]; | 230 List<UnlinkedUnit> serializedUnits = <UnlinkedUnit>[unlinkedSummary]; |
| 229 for (String part in serializedUnits[0].publicNamespace.parts) { | 231 for (String part in serializedUnits[0].publicNamespace.parts) { |
| 230 Source partSource = sourceFactory.resolveUri(librarySource, part); | 232 Source partSource = sourceFactory.resolveUri(librarySource, part); |
| 231 String partAbsUri = partSource.uri.toString(); | 233 String partAbsUri = partSource.uri.toString(); |
| (...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 static String _getElementIdentifier(String name, ReferenceKind kind) { | 1894 static String _getElementIdentifier(String name, ReferenceKind kind) { |
| 1893 if (kind == ReferenceKind.topLevelPropertyAccessor || | 1895 if (kind == ReferenceKind.topLevelPropertyAccessor || |
| 1894 kind == ReferenceKind.propertyAccessor) { | 1896 kind == ReferenceKind.propertyAccessor) { |
| 1895 if (!name.endsWith('=')) { | 1897 if (!name.endsWith('=')) { |
| 1896 return name + '?'; | 1898 return name + '?'; |
| 1897 } | 1899 } |
| 1898 } | 1900 } |
| 1899 return name; | 1901 return name; |
| 1900 } | 1902 } |
| 1901 } | 1903 } |
| OLD | NEW |