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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/compiler.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
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/diagnostic_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index 99cfb248bfac316fb805738aad4873d7fedb17f1..03b8c4e984996896b90bafa5036c5bf6ebf2ec11 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -766,12 +766,13 @@ abstract class Compiler implements DiagnosticListener {
reportDiagnostic(span, "$message", kind);
}
- void onDeprecatedFeature(Spannable span, String feature) {
+ /// Returns true if a diagnostic was emitted.
+ bool onDeprecatedFeature(Spannable span, String feature) {
if (currentElement == null)
throw new SpannableAssertionFailure(span, feature);
if (!checkDeprecationInSdk &&
currentElement.getLibrary().isPlatformLibrary) {
- return;
+ return false;
}
var kind = rejectDeprecatedFeatures
? api.Diagnostic.ERROR : api.Diagnostic.WARNING;
@@ -779,6 +780,7 @@ abstract class Compiler implements DiagnosticListener {
? MessageKind.DEPRECATED_FEATURE_ERROR.error([feature])
: MessageKind.DEPRECATED_FEATURE_WARNING.error([feature]);
reportMessage(spanFromSpannable(span), message, kind);
+ return true;
}
void reportDiagnostic(SourceSpan span, String message, api.Diagnostic kind);
@@ -805,7 +807,7 @@ abstract class Compiler implements DiagnosticListener {
if (Elements.isErroneousElement(element)) {
element = element.enclosingElement;
}
- if (element.position() == null) {
+ if (element.position() == null && !element.isCompilationUnit()) {
// Sometimes, the backend fakes up elements that have no
// position. So we use the enclosing element instead. It is
// not a good error location, but cancel really is "internal
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/diagnostic_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698