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

Unified Diff: pkg/front_end/lib/src/fasta/builder/library_builder.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/builder/library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/builder/library_builder.dart b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
index 8ec419c84f7811791d6f067489b7ac9b482313a9..551962614edeee49583fadb2ada908ad6319720a 100644
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -6,13 +6,13 @@ library fasta.library_builder;
import '../combinator.dart' show Combinator;
-import '../errors.dart' show internalError;
+import '../deprecated_problems.dart' show deprecated_internalProblem;
import '../export.dart' show Export;
import '../loader.dart' show Loader;
-import '../messages.dart' show nit, warning;
+import '../messages.dart' show deprecated_nit, deprecated_warning;
import '../util/relativize.dart' show relativizeUri;
@@ -67,30 +67,31 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
exporters.add(new Export(exporter, this, combinators, charOffset));
}
- /// See `Loader.addCompileTimeError` for an explanation of the arguments
- /// passed to this method.
+ /// See `Loader.deprecated_addCompileTimeError` for an explanation of the
+ /// arguments passed to this method.
///
/// If [fileUri] is null, it defaults to `this.fileUri`.
- void addCompileTimeError(int charOffset, Object message,
+ void deprecated_addCompileTimeError(int charOffset, Object message,
{Uri fileUri, bool silent: false, bool wasHandled: false}) {
hasCompileTimeErrors = true;
- loader.addCompileTimeError(fileUri ?? this.fileUri, charOffset, message,
+ loader.deprecated_addCompileTimeError(
+ fileUri ?? this.fileUri, charOffset, message,
silent: silent, wasHandled: wasHandled);
}
- void addWarning(int charOffset, Object message,
+ void deprecated_addWarning(int charOffset, Object message,
{Uri fileUri, bool silent: false}) {
fileUri ??= this.fileUri;
if (!silent) {
- warning(fileUri, charOffset, message);
+ deprecated_warning(fileUri, charOffset, message);
}
}
- void addNit(int charOffset, Object message,
+ void deprecated_addNit(int charOffset, Object message,
{Uri fileUri, bool silent: false}) {
fileUri ??= this.fileUri;
if (!silent) {
- nit(fileUri, charOffset, message);
+ deprecated_nit(fileUri, charOffset, message);
}
}
@@ -139,7 +140,8 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
{String constructorName, bool bypassLibraryPrivacy: false}) {
constructorName ??= "";
if (constructorName.startsWith("_") && !bypassLibraryPrivacy) {
- throw internalError("Internal error: Can't access private constructor "
+ throw deprecated_internalProblem(
+ "Internal error: Can't access private constructor "
"'$constructorName'.");
}
Builder cls =
@@ -159,7 +161,7 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
return constructor;
}
}
- throw internalError("Internal error: No constructor named"
+ throw deprecated_internalProblem("Internal error: No constructor named"
" '$className::$constructorName' in '$uri'.");
}
@@ -178,7 +180,8 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
/// Don't use for scope lookup. Only use when an element is known to exist
/// (and not a setter).
Builder operator [](String name) {
- return scope.local[name] ?? internalError("Not found: '$name'.");
+ return scope.local[name] ??
+ deprecated_internalProblem("Not found: '$name'.");
}
Builder lookup(String name, int charOffset, Uri fileUri) {

Powered by Google App Engine
This is Rietveld 408576698