| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 analyzer.test.src.summary.prelinker_test; | 5 library analyzer.test.src.summary.prelinker_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
| 9 import 'package:analyzer/src/generated/source_io.dart'; | 9 import 'package:analyzer/src/generated/source_io.dart'; |
| 10 import 'package:analyzer/src/summary/format.dart'; | 10 import 'package:analyzer/src/summary/format.dart'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 final Map<String, UnlinkedPublicNamespace> uriToPublicNamespace = | 30 final Map<String, UnlinkedPublicNamespace> uriToPublicNamespace = |
| 31 <String, UnlinkedPublicNamespace>{}; | 31 <String, UnlinkedPublicNamespace>{}; |
| 32 | 32 |
| 33 @override | 33 @override |
| 34 bool get expectAbsoluteUrisInDependencies => false; | 34 bool get expectAbsoluteUrisInDependencies => false; |
| 35 | 35 |
| 36 @override | 36 @override |
| 37 bool get skipFullyLinkedData => true; | 37 bool get skipFullyLinkedData => true; |
| 38 | 38 |
| 39 @override | 39 @override |
| 40 bool get strongMode => false; |
| 41 |
| 42 @override |
| 40 Source addNamedSource(String filePath, String contents) { | 43 Source addNamedSource(String filePath, String contents) { |
| 41 Source source = super.addNamedSource(filePath, contents); | 44 Source source = super.addNamedSource(filePath, contents); |
| 42 uriToPublicNamespace[absUri(filePath)] = | 45 uriToPublicNamespace[absUri(filePath)] = |
| 43 computePublicNamespaceFromText(contents, source); | 46 computePublicNamespaceFromText(contents, source); |
| 44 return source; | 47 return source; |
| 45 } | 48 } |
| 46 | 49 |
| 47 String resolveToAbsoluteUri(LibraryElement library, String relativeUri) { | 50 String resolveToAbsoluteUri(LibraryElement library, String relativeUri) { |
| 48 Source resolvedSource = | 51 Source resolvedSource = |
| 49 analysisContext.sourceFactory.resolveUri(library.source, relativeUri); | 52 analysisContext.sourceFactory.resolveUri(library.source, relativeUri); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 80 fail('Prelinker unexpectedly requested namespace for "$relativeUri"' | 83 fail('Prelinker unexpectedly requested namespace for "$relativeUri"' |
| 81 ' (resolves to "$absoluteUri").' | 84 ' (resolves to "$absoluteUri").' |
| 82 ' Namespaces available: ${uriToPublicNamespace.keys}'); | 85 ' Namespaces available: ${uriToPublicNamespace.keys}'); |
| 83 } | 86 } |
| 84 return namespace; | 87 return namespace; |
| 85 } | 88 } |
| 86 linked = new LinkedLibrary.fromBuffer( | 89 linked = new LinkedLibrary.fromBuffer( |
| 87 prelink(unlinkedUnits[0], getPart, getImport).toBuffer()); | 90 prelink(unlinkedUnits[0], getPart, getImport).toBuffer()); |
| 88 } | 91 } |
| 89 } | 92 } |
| OLD | NEW |