Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Side by Side Diff: pkg/analyzer/lib/src/generated/source_io.dart

Issue 1223833008: Package map source factory support [FIXED]. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.source.io; 8 library engine.source.io;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 static String FILE_SCHEME = "file"; 276 static String FILE_SCHEME = "file";
277 277
278 @override 278 @override
279 Source resolveAbsolute(Uri uri) { 279 Source resolveAbsolute(Uri uri) {
280 if (!isFileUri(uri)) { 280 if (!isFileUri(uri)) {
281 return null; 281 return null;
282 } 282 }
283 return new FileBasedSource(new JavaFile.fromUri(uri), uri); 283 return new FileBasedSource(new JavaFile.fromUri(uri), uri);
284 } 284 }
285 285
286 @override
287 Uri restoreAbsolute(Source source) {
288 if (source is FileBasedSource) {
289 return new Uri.file(source.fullName);
290 }
291 return null;
292 }
293
286 /** 294 /**
287 * Return `true` if the given URI is a `file` URI. 295 * Return `true` if the given URI is a `file` URI.
288 * 296 *
289 * @param uri the URI being tested 297 * @param uri the URI being tested
290 * @return `true` if the given URI is a `file` URI 298 * @return `true` if the given URI is a `file` URI
291 */ 299 */
292 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; 300 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
293 } 301 }
294 302
295 /** 303 /**
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 553 }
546 554
547 /** 555 /**
548 * Return `true` if the given URI is a `file` URI. 556 * Return `true` if the given URI is a `file` URI.
549 * 557 *
550 * @param uri the URI being tested 558 * @param uri the URI being tested
551 * @return `true` if the given URI is a `file` URI 559 * @return `true` if the given URI is a `file` URI
552 */ 560 */
553 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; 561 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
554 } 562 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698