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

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

Issue 25006003: Revert "Allow import/export of libraries with no name." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 }
424 }); 433 });
425 }); 434 });
426 } 435 }
427 436
428 /** 437 /**
429 * Create (or reuse) a library element for the library specified by the 438 * Create (or reuse) a library element for the library specified by the
430 * [resolvedUri]. 439 * [resolvedUri].
431 * 440 *
432 * If a new library is created, the [handler] is notified. 441 * If a new library is created, the [handler] is notified.
433 */ 442 */
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 } 868 }
860 869
861 /** 870 /**
862 * Registers all top-level entities of [library] as starting point for the 871 * Registers all top-level entities of [library] as starting point for the
863 * fixed-point computation of the import/export scopes. 872 * fixed-point computation of the import/export scopes.
864 */ 873 */
865 void registerLibraryExports(LibraryElement library) { 874 void registerLibraryExports(LibraryElement library) {
866 nodeMap[library].registerInitialExports(); 875 nodeMap[library].registerInitialExports();
867 } 876 }
868 } 877 }
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