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

Unified Diff: pkg/compiler/lib/src/serialization/system.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
« no previous file with comments | « pkg/compiler/lib/src/serialization/serialization_util.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/system.dart
diff --git a/pkg/compiler/lib/src/serialization/system.dart b/pkg/compiler/lib/src/serialization/system.dart
index b2507121608242fa553a1653cd92524e44bfee57..4d05ff8b3f50c92a69fd07acf70030150ccf1527 100644
--- a/pkg/compiler/lib/src/serialization/system.dart
+++ b/pkg/compiler/lib/src/serialization/system.dart
@@ -88,8 +88,8 @@ class ResolutionDeserializerSystem extends DeserializerSystem {
@override
WorldImpact computeWorldImpact(Element element) {
ResolutionImpact resolutionImpact = getResolutionImpact(element);
- assert(invariant(element, resolutionImpact != null,
- message: 'No impact found for $element (${element.library})'));
+ assert(resolutionImpact != null,
+ failedAt(element, 'No impact found for $element (${element.library})'));
if (element is ExecutableElement) {
getResolvedAst(element);
}
@@ -160,8 +160,11 @@ class CompilationDeserializerSystem extends ResolutionDeserializerSystem {
ClassElement superclass = constructor.enclosingClass.superclass;
ConstructorElement superclassConstructor =
superclass.lookupConstructor(constructor.name);
- assert(invariant(element, superclassConstructor != null,
- message: "Superclass constructor '${constructor.name}' called from "
+ assert(
+ superclassConstructor != null,
+ failedAt(
+ element,
+ "Superclass constructor '${constructor.name}' called from "
"${element} not found in ${superclass}."));
// TODO(johnniwinther): Compute callStructure. Currently not used.
CallStructure callStructure;
@@ -258,12 +261,12 @@ class ResolvedAstSerializerPlugin extends SerializerPlugin {
@override
void onElement(Element element, ObjectEncoder createEncoder(String tag)) {
- assert(invariant(element, element.isDeclaration,
- message: "Element $element must be the declaration"));
+ assert(element.isDeclaration,
+ failedAt(element, "Element $element must be the declaration"));
if (element.isError) return;
if (element is MemberElement) {
- assert(invariant(element, resolution.hasResolvedAst(element),
- message: "Element $element must have a resolved ast"));
+ assert(resolution.hasResolvedAst(element),
+ failedAt(element, "Element $element must have a resolved ast"));
ResolvedAst resolvedAst = resolution.getResolvedAst(element);
ObjectEncoder objectEncoder = createEncoder(RESOLVED_AST_TAG);
new ResolvedAstSerializer(
@@ -299,8 +302,8 @@ class ResolvedAstDeserializerPlugin extends DeserializerPlugin {
ResolvedAstDeserializer.deserialize(element.memberContext, decoder,
parsingContext, findToken, nativeDataDeserializer);
_decoderMap.remove(element);
- assert(invariant(element, element.hasResolvedAst,
- message: "ResolvedAst not computed for $element."));
+ assert(element.hasResolvedAst,
+ failedAt(element, "ResolvedAst not computed for $element."));
return element.resolvedAst;
}
return null;
« no previous file with comments | « pkg/compiler/lib/src/serialization/serialization_util.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698