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

Unified Diff: pkg/analyzer/lib/src/generated/utilities_dart.dart

Issue 2668553002: Move resolveRelativeUri into front_end. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/base/resolve_relative_uri.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/utilities_dart.dart
diff --git a/pkg/analyzer/lib/src/generated/utilities_dart.dart b/pkg/analyzer/lib/src/generated/utilities_dart.dart
index fe05c1e9ee9c57ab0bea58b8ac391c99d0916a13..3bdb6e913057d388dbc535b882009e0473d2119c 100644
--- a/pkg/analyzer/lib/src/generated/utilities_dart.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_dart.dart
@@ -6,40 +6,10 @@ library analyzer.src.generated.utilities_dart;
import 'package:analyzer/dart/ast/ast.dart' show AnnotatedNode, Comment;
import 'package:analyzer/dart/ast/token.dart' show Token;
-import 'package:analyzer/exception/exception.dart';
import 'package:analyzer/src/dart/element/element.dart' show ElementImpl;
-import 'package:analyzer/src/generated/source.dart';
-/**
- * Resolve the [containedUri] against [baseUri] using Dart rules.
- *
- * This function behaves similarly to [Uri.resolveUri], except that it properly
- * handles situations like the following:
- *
- * resolveRelativeUri(dart:core, bool.dart) -> dart:core/bool.dart
- * resolveRelativeUri(package:a/b.dart, ../c.dart) -> package:a/c.dart
- */
-Uri resolveRelativeUri(Uri baseUri, Uri containedUri) {
- if (containedUri.isAbsolute) {
- return containedUri;
- }
- Uri origBaseUri = baseUri;
- try {
- String scheme = baseUri.scheme;
- // dart:core => dart:core/core.dart
- if (scheme == DartUriResolver.DART_SCHEME) {
- String part = baseUri.path;
- if (part.indexOf('/') < 0) {
- baseUri = Uri.parse('$scheme:$part/$part.dart');
- }
- }
- return baseUri.resolveUri(containedUri);
- } catch (exception, stackTrace) {
- throw new AnalysisException(
- "Could not resolve URI ($containedUri) relative to source ($origBaseUri)",
- new CaughtException(exception, stackTrace));
- }
-}
+export 'package:front_end/src/base/resolve_relative_uri.dart'
+ show resolveRelativeUri;
/**
* If the given [node] has a documentation comment, remember its content
« no previous file with comments | « no previous file | pkg/front_end/lib/src/base/resolve_relative_uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698