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

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

Issue 2974933002: Remove deprecated_internalProblem. (Closed)
Patch Set: 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 bc73de549f032bed185a4221bdbd387eaeeb590f..5dbaa438f39d671b631cfa509e752e1cd39f1793 100644
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -6,14 +6,22 @@ library fasta.library_builder;
import '../combinator.dart' show Combinator;
-import '../deprecated_problems.dart' show deprecated_internalProblem;
+import '../problems.dart' show internalProblem;
import '../export.dart' show Export;
import '../loader.dart' show Loader;
import '../messages.dart'
- show Message, deprecated_nit, deprecated_warning, nit, warning;
+ show
+ Message,
+ deprecated_nit,
+ deprecated_warning,
+ nit,
+ templateInternalProblemConstructorNotFound,
+ templateInternalProblemNotFoundIn,
+ templateInternalProblemPrivateConstructorAccess,
+ warning;
import '../util/relativize.dart' show relativizeUri;
@@ -161,9 +169,11 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
{String constructorName, bool bypassLibraryPrivacy: false}) {
constructorName ??= "";
if (constructorName.startsWith("_") && !bypassLibraryPrivacy) {
- throw deprecated_internalProblem(
- "Internal error: Can't access private constructor "
- "'$constructorName'.");
+ return internalProblem(
+ templateInternalProblemPrivateConstructorAccess
+ .withArguments(constructorName),
+ -1,
+ null);
}
Builder cls =
(bypassLibraryPrivacy ? scope : exports).lookup(className, -1, null);
@@ -182,8 +192,11 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
return constructor;
}
}
- throw deprecated_internalProblem("Internal error: No constructor named"
- " '$className::$constructorName' in '$uri'.");
+ throw internalProblem(
+ templateInternalProblemConstructorNotFound.withArguments(
+ "$className::$constructorName", uri),
+ -1,
+ null);
}
int finishTypeVariables(ClassBuilder object) => 0;
@@ -202,7 +215,11 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
/// (and not a setter).
Builder operator [](String name) {
return scope.local[name] ??
- deprecated_internalProblem("Not found: '$name'.");
+ internalProblem(
+ templateInternalProblemNotFoundIn.withArguments(
+ name, relativeFileUri),
+ -1,
+ null);
}
Builder lookup(String name, int charOffset, Uri fileUri) {

Powered by Google App Engine
This is Rietveld 408576698