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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/library_loader.dart

Issue 25251003: Allow import/export of libraries with no name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status Created 7 years, 2 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 | « no previous file | tests/co19/co19-dart2dart.status » ('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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * [CompilerTask] for loading libraries and setting up the import/export scopes. 8 * [CompilerTask] for loading libraries and setting up the import/export scopes.
9 * 9 *
10 * The library loader uses four different kinds of URIs in different parts of 10 * The library loader uses four different kinds of URIs in different parts of
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 Future registerLibraryFromTag(LibraryDependencyHandler handler, 414 Future registerLibraryFromTag(LibraryDependencyHandler handler,
415 LibraryElement library, 415 LibraryElement library,
416 LibraryDependency tag) { 416 LibraryDependency tag) {
417 Uri base = library.entryCompilationUnit.script.uri; 417 Uri base = library.entryCompilationUnit.script.uri;
418 Uri resolvedUri = base.resolve(tag.uri.dartString.slowToString()); 418 Uri resolvedUri = base.resolve(tag.uri.dartString.slowToString());
419 return createLibrary(handler, library, resolvedUri, tag.uri, resolvedUri) 419 return createLibrary(handler, library, resolvedUri, tag.uri, resolvedUri)
420 .then((LibraryElement loadedLibrary) { 420 .then((LibraryElement loadedLibrary) {
421 if (loadedLibrary == null) return; 421 if (loadedLibrary == null) return;
422 compiler.withCurrentElement(library, () { 422 compiler.withCurrentElement(library, () {
423 handler.registerDependency(library, tag, loadedLibrary); 423 handler.registerDependency(library, tag, loadedLibrary);
424
425 if (!loadedLibrary.hasLibraryName()) {
426 compiler.reportFatalError(
427 tag == null ? null : tag.uri,
428 MessageKind.GENERIC,
429 {'text':
430 'Error: No library name found in '
431 '${loadedLibrary.canonicalUri}.'});
432 }
433 }); 424 });
434 }); 425 });
435 } 426 }
436 427
437 /** 428 /**
438 * Create (or reuse) a library element for the library specified by the 429 * Create (or reuse) a library element for the library specified by the
439 * [resolvedUri]. 430 * [resolvedUri].
440 * 431 *
441 * If a new library is created, the [handler] is notified. 432 * If a new library is created, the [handler] is notified.
442 */ 433 */
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 } 859 }
869 860
870 /** 861 /**
871 * Registers all top-level entities of [library] as starting point for the 862 * Registers all top-level entities of [library] as starting point for the
872 * fixed-point computation of the import/export scopes. 863 * fixed-point computation of the import/export scopes.
873 */ 864 */
874 void registerLibraryExports(LibraryElement library) { 865 void registerLibraryExports(LibraryElement library) {
875 nodeMap[library].registerInitialExports(); 866 nodeMap[library].registerInitialExports();
876 } 867 }
877 } 868 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698