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

Unified Diff: pkg/compiler/lib/src/serialization/serialization_util.dart

Issue 2898403002: Use failedAt in more places (Closed)
Patch Set: merge; address comments Created 3 years, 7 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/compiler/lib/src/serialization/serialization_util.dart
diff --git a/pkg/compiler/lib/src/serialization/serialization_util.dart b/pkg/compiler/lib/src/serialization/serialization_util.dart
index ef8780be8843f9215c2d01d983fd82c03faa2595..f044f73743f82fdce54fe98a32f6acad93786b5b 100644
--- a/pkg/compiler/lib/src/serialization/serialization_util.dart
+++ b/pkg/compiler/lib/src/serialization/serialization_util.dart
@@ -488,8 +488,11 @@ void serializeElementReference(Element context, Key elementKey, Key nameKey,
ObjectEncoder encoder, Element element) {
if (element.isGenerativeConstructor &&
element.enclosingClass.isUnnamedMixinApplication) {
- assert(invariant(element, element.isConstructor,
- message: "Unexpected reference of forwarding constructor "
+ assert(
+ element.isConstructor,
+ failedAt(
+ element,
+ "Unexpected reference of forwarding constructor "
"${element} from $context."));
encoder.setString(nameKey, element.name);
} else {
@@ -512,20 +515,29 @@ Element deserializeElementReference(
}
ClassElement cls;
if (context is ClassElement) {
- assert(invariant(NO_LOCATION_SPANNABLE, context.isNamedMixinApplication,
- message: "Unexpected reference of forwarding constructor "
+ assert(
+ context.isNamedMixinApplication,
+ failedAt(
+ NO_LOCATION_SPANNABLE,
+ "Unexpected reference of forwarding constructor "
"'${elementName}' from $context."));
cls = context;
} else {
- assert(invariant(NO_LOCATION_SPANNABLE, context.isConstructor,
- message: "Unexpected reference of forwarding constructor "
+ assert(
+ context.isConstructor,
+ failedAt(
+ NO_LOCATION_SPANNABLE,
+ "Unexpected reference of forwarding constructor "
"'${elementName}' from $context."));
cls = context.enclosingClass;
}
ClassElement superclass = cls.superclass;
element = superclass.lookupConstructor(elementName);
- assert(invariant(NO_LOCATION_SPANNABLE, element != null,
- message: "Unresolved reference of forwarding constructor "
+ assert(
+ element != null,
+ failedAt(
+ NO_LOCATION_SPANNABLE,
+ "Unresolved reference of forwarding constructor "
"'${elementName}' from $context."));
}
return element;
« no previous file with comments | « pkg/compiler/lib/src/serialization/serialization.dart ('k') | pkg/compiler/lib/src/serialization/system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698