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

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

Issue 1564803002: Specialize message for parts as entry point (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 4 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 unified diff | Download patch
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 'common.dart'; 9 import 'common.dart';
10 import 'common/names.dart' show 10 import 'common/names.dart' show
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 LibraryElement element = 642 LibraryElement element =
643 createLibrarySync(handler, script, resolvedUri); 643 createLibrarySync(handler, script, resolvedUri);
644 CompilationUnitElementX compilationUnit = element.entryCompilationUnit; 644 CompilationUnitElementX compilationUnit = element.entryCompilationUnit;
645 if (compilationUnit.partTag != null) { 645 if (compilationUnit.partTag != null) {
646 if (skipFileWithPartOfTag) { 646 if (skipFileWithPartOfTag) {
647 // TODO(johnniwinther): Avoid calling [Compiler.onLibraryCreated] 647 // TODO(johnniwinther): Avoid calling [Compiler.onLibraryCreated]
648 // for this library. 648 // for this library.
649 libraryCanonicalUriMap.remove(resolvedUri); 649 libraryCanonicalUriMap.remove(resolvedUri);
650 return null; 650 return null;
651 } 651 }
652 DiagnosticMessage error = reporter.withCurrentElement( 652 if (importingLibrary == null) {
653 compilationUnit, 653 DiagnosticMessage error = reporter.withCurrentElement(
654 () => reporter.createMessage( 654 compilationUnit,
655 compilationUnit.partTag, MessageKind.IMPORT_PART_OF)); 655 () => reporter.createMessage(
656 DiagnosticMessage info = reporter.withCurrentElement( 656 compilationUnit.partTag, MessageKind.MAIN_HAS_PART_OF));
657 importingLibrary, 657 reporter.reportError(error);
658 () => reporter.createMessage( 658 } else {
659 node, 659 DiagnosticMessage error = reporter.withCurrentElement(
660 MessageKind.IMPORT_PART_OF_HERE)); 660 compilationUnit,
661 reporter.reportError(error, <DiagnosticMessage>[info]); 661 () => reporter.createMessage(
662 compilationUnit.partTag, MessageKind.IMPORT_PART_OF));
663 DiagnosticMessage info = reporter.withCurrentElement(
664 importingLibrary,
665 () => reporter.createMessage(
666 node,
667 MessageKind.IMPORT_PART_OF_HERE));
668 reporter.reportError(error, [info]);
669 }
662 } 670 }
663 return processLibraryTags(handler, element).then((_) { 671 return processLibraryTags(handler, element).then((_) {
664 reporter.withCurrentElement(element, () { 672 reporter.withCurrentElement(element, () {
665 handler.registerLibraryExports(element); 673 handler.registerLibraryExports(element);
666 }); 674 });
667 return element; 675 return element;
668 }); 676 });
669 }); 677 });
670 }); 678 });
671 } 679 }
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 } 1400 }
1393 suffixes.add(const Link<Uri>().prepend(canonicalUri)); 1401 suffixes.add(const Link<Uri>().prepend(canonicalUri));
1394 } 1402 }
1395 suffixChainMap[library] = suffixes; 1403 suffixChainMap[library] = suffixes;
1396 return; 1404 return;
1397 } 1405 }
1398 1406
1399 computeSuffixes(rootLibrary, const Link<Uri>()); 1407 computeSuffixes(rootLibrary, const Link<Uri>());
1400 } 1408 }
1401 } 1409 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | tests/compiler/dart2js/diagnostic_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698