| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.src.generated.source; | 5 library analyzer.src.generated.source; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 @override | 106 @override |
| 107 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 107 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 108 String mapping = _urlMappings[uri.toString()]; | 108 String mapping = _urlMappings[uri.toString()]; |
| 109 if (mapping == null) return null; | 109 if (mapping == null) return null; |
| 110 | 110 |
| 111 Uri fileUri = new Uri.file(mapping); | 111 Uri fileUri = new Uri.file(mapping); |
| 112 if (!fileUri.isAbsolute) return null; | 112 if (!fileUri.isAbsolute) return null; |
| 113 | 113 |
| 114 JavaFile javaFile = new JavaFile.fromUri(fileUri); | 114 JavaFile javaFile = new JavaFile.fromUri(fileUri); |
| 115 return new FileBasedSource(javaFile, actualUri != null ? actualUri : uri); | 115 return new FileBasedSource(javaFile, actualUri ?? uri); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * Instances of the class `DartUriResolver` resolve `dart` URI's. | 120 * Instances of the class `DartUriResolver` resolve `dart` URI's. |
| 121 */ | 121 */ |
| 122 class DartUriResolver extends UriResolver { | 122 class DartUriResolver extends UriResolver { |
| 123 /** | 123 /** |
| 124 * The name of the `dart` scheme. | 124 * The name of the `dart` scheme. |
| 125 */ | 125 */ |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 Source resolveAbsolute(Uri uri, [Uri actualUri]); | 930 Source resolveAbsolute(Uri uri, [Uri actualUri]); |
| 931 | 931 |
| 932 /** | 932 /** |
| 933 * Return an absolute URI that represents the given [source], or `null` if a | 933 * Return an absolute URI that represents the given [source], or `null` if a |
| 934 * valid URI cannot be computed. | 934 * valid URI cannot be computed. |
| 935 * | 935 * |
| 936 * The computation should be based solely on [source.fullName]. | 936 * The computation should be based solely on [source.fullName]. |
| 937 */ | 937 */ |
| 938 Uri restoreAbsolute(Source source) => null; | 938 Uri restoreAbsolute(Source source) => null; |
| 939 } | 939 } |
| OLD | NEW |