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

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

Issue 1262213002: Ensure actual URIs are properly processed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 relPath = path.substring(index + 1); 453 relPath = path.substring(index + 1);
454 } 454 }
455 for (JavaFile packagesDirectory in _packagesDirectories) { 455 for (JavaFile packagesDirectory in _packagesDirectories) {
456 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path); 456 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path);
457 if (resolvedFile.exists()) { 457 if (resolvedFile.exists()) {
458 JavaFile canonicalFile = 458 JavaFile canonicalFile =
459 getCanonicalFile(packagesDirectory, pkgName, relPath); 459 getCanonicalFile(packagesDirectory, pkgName, relPath);
460 if (_isSelfReference(packagesDirectory, canonicalFile)) { 460 if (_isSelfReference(packagesDirectory, canonicalFile)) {
461 uri = canonicalFile.toURI(); 461 uri = canonicalFile.toURI();
462 } 462 }
463 return new FileBasedSource(canonicalFile, uri); 463 return new FileBasedSource(
464 canonicalFile, actualUri != null ? actualUri : uri);
464 } 465 }
465 } 466 }
466 return new FileBasedSource( 467 return new FileBasedSource(
467 getCanonicalFile(_packagesDirectories[0], pkgName, relPath), 468 getCanonicalFile(_packagesDirectories[0], pkgName, relPath),
468 actualUri != null ? actualUri : uri); 469 actualUri != null ? actualUri : uri);
469 } 470 }
470 471
471 @override 472 @override
472 Uri restoreAbsolute(Source source) { 473 Uri restoreAbsolute(Source source) {
473 String sourcePath = source.fullName; 474 String sourcePath = source.fullName;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 } 556 }
556 557
557 /** 558 /**
558 * Return `true` if the given URI is a `file` URI. 559 * Return `true` if the given URI is a `file` URI.
559 * 560 *
560 * @param uri the URI being tested 561 * @param uri the URI being tested
561 * @return `true` if the given URI is a `file` URI 562 * @return `true` if the given URI is a `file` URI
562 */ 563 */
563 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; 564 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
564 } 565 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698