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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/library_loader.dart

Issue 11464025: dart2js: complain about missing part-of tags. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years 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
Index: dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart b/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
index 6a247e209c633f2df7c821a03215fdccb00968a8..3472b3eb2672d39552ac30775ffc141695e7bdd8 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
@@ -268,7 +268,22 @@ class LibraryLoaderTask extends LibraryLoader {
Script sourceScript = compiler.readScript(path, part);
CompilationUnitElement unit =
new CompilationUnitElement(sourceScript, library);
- compiler.withCurrentElement(unit, () => compiler.scanner.scan(unit));
+ compiler.withCurrentElement(unit, () {
+ compiler.scanner.scan(unit);
+ if (unit.partTag == null) {
+ bool wasDiagnosticEmitted = false;
+ compiler.withCurrentElement(library, () {
+ wasDiagnosticEmitted =
+ compiler.onDeprecatedFeature(part, 'missing part-of tag');
+ });
+ if (wasDiagnosticEmitted) {
+ compiler.reportMessage(
+ compiler.spanFromElement(unit),
+ MessageKind.MISSING_PART_OF_TAG.error([]),
+ api.Diagnostic.INFO);
+ }
+ }
+ });
}
/**

Powered by Google App Engine
This is Rietveld 408576698