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

Unified Diff: pkg/compiler/lib/src/closure.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/apiimpl.dart ('k') | pkg/compiler/lib/src/common/resolution.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 908ecce3f2bba1685519424772ae04ca9f959440..653157d1be02183928fa4b62d14254e71a9b4700 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -44,8 +44,10 @@ class ClosureTask extends CompilerTask {
element = constructorBody.constructor;
}
ClosureClassMap closureClassMap = _closureMappingCache[element];
- assert(invariant(resolvedAst.element, closureClassMap != null,
- message: "No ClosureClassMap computed for ${element}."));
+ assert(
+ closureClassMap != null,
+ failedAt(resolvedAst.element,
+ "No ClosureClassMap computed for ${element}."));
return closureClassMap;
});
}
@@ -93,22 +95,25 @@ class ClosureTask extends CompilerTask {
_closureMappingCache[element] =
new ClosureClassMap(null, null, null, new ThisLocal(element));
} else {
- assert(invariant(element, element.isField,
- message: "Expected $element to be a field."));
+ assert(element.isField,
+ failedAt(element, "Expected $element to be a field."));
Node initializer = resolvedAst.body;
if (initializer != null) {
// The lazy initializer of a static.
translator.translateLazyInitializer(element, node, initializer);
} else {
- assert(invariant(element, element.isInstanceMember,
- message: "Expected $element (${element
- .runtimeType}) to be an instance field."));
+ assert(
+ element.isInstanceMember,
+ failedAt(
+ element,
+ "Expected $element (${element.runtimeType}) "
+ "to be an instance field."));
_closureMappingCache[element] =
new ClosureClassMap(null, null, null, new ThisLocal(element));
}
}
- assert(invariant(element, _closureMappingCache[element] != null,
- message: "No ClosureClassMap computed for ${element}."));
+ assert(_closureMappingCache[element] != null,
+ failedAt(element, "No ClosureClassMap computed for ${element}."));
return _closureMappingCache[element];
});
});
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | pkg/compiler/lib/src/common/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698