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

Side by Side Diff: pkg/compiler/lib/src/library_loader.dart

Issue 1131593006: Report malformed URIs in library dependencies (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update copyright in test Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.library_loader; 5 library dart2js.library_loader;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'dart2jslib.dart' show 9 import 'dart2jslib.dart' show
10 Compiler, 10 Compiler,
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 /** 499 /**
500 * Handle an import/export tag by loading the referenced library and 500 * Handle an import/export tag by loading the referenced library and
501 * registering its dependency in [handler] for the computation of the import/ 501 * registering its dependency in [handler] for the computation of the import/
502 * export scope. 502 * export scope.
503 */ 503 */
504 Future registerLibraryFromTag(LibraryDependencyHandler handler, 504 Future registerLibraryFromTag(LibraryDependencyHandler handler,
505 LibraryElement library, 505 LibraryElement library,
506 LibraryDependency tag) { 506 LibraryDependency tag) {
507 Uri base = library.canonicalUri; 507 Uri base = library.canonicalUri;
508 Uri resolvedUri = base.resolve(tag.uri.dartString.slowToString()); 508 String tagUriString = tag.uri.dartString.slowToString();
509 Uri resolvedUri;
510 try {
511 resolvedUri = base.resolve(tagUriString);
512 } on FormatException {
513 compiler.reportError(
514 tag, MessageKind.INVALID_URI, {'uri': tagUriString});
515 return new Future.value();
floitsch 2015/05/06 21:19:00 This return feels fishy. Is the convention that th
516 }
509 return createLibrary(handler, library, resolvedUri, tag.uri) 517 return createLibrary(handler, library, resolvedUri, tag.uri)
510 .then((LibraryElement loadedLibrary) { 518 .then((LibraryElement loadedLibrary) {
511 if (loadedLibrary == null) return; 519 if (loadedLibrary == null) return;
512 compiler.withCurrentElement(library, () { 520 compiler.withCurrentElement(library, () {
513 handler.registerDependency(library, tag, loadedLibrary); 521 handler.registerDependency(library, tag, loadedLibrary);
514 }); 522 });
515 }); 523 });
516 } 524 }
517 525
518 /** 526 /**
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 } 1194 }
1187 suffixes.add(const Link<Uri>().prepend(canonicalUri)); 1195 suffixes.add(const Link<Uri>().prepend(canonicalUri));
1188 } 1196 }
1189 suffixChainMap[library] = suffixes; 1197 suffixChainMap[library] = suffixes;
1190 return; 1198 return;
1191 } 1199 }
1192 1200
1193 computeSuffixes(rootLibrary, const Link<Uri>()); 1201 computeSuffixes(rootLibrary, const Link<Uri>());
1194 } 1202 }
1195 } 1203 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698