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

Unified Diff: pkg/compiler/lib/src/js_backend/backend_usage.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/js_backend/backend_usage.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend_usage.dart b/pkg/compiler/lib/src/js_backend/backend_usage.dart
index 068c16a3fca03da9b0f8aaada554ec2ca749a82a..8f83e04815700deceef21eab2c439c7f28774fe2 100644
--- a/pkg/compiler/lib/src/js_backend/backend_usage.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart
@@ -122,23 +122,23 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
@override
void registerBackendFunctionUse(FunctionEntity element) {
- assert(invariant(element, _isValidBackendUse(element),
- message: "Backend use of $element is not allowed."));
+ assert(_isValidBackendUse(element),
+ failedAt(element, "Backend use of $element is not allowed."));
_helperFunctionsUsed.add(element);
}
@override
void registerBackendClassUse(ClassEntity element) {
- assert(invariant(element, _isValidBackendUse(element),
- message: "Backend use of $element is not allowed."));
+ assert(_isValidBackendUse(element),
+ failedAt(element, "Backend use of $element is not allowed."));
_helperClassesUsed.add(element);
}
bool _isValidBackendUse(Entity element) {
if (_isValidEntity(element)) return true;
if (element is Element) {
- assert(invariant(element, element.isDeclaration,
- message: "Backend use $element must be the declaration."));
+ assert(element.isDeclaration,
+ failedAt(element, "Backend use $element must be the declaration."));
if (element.implementationLibrary.isPatch ||
// Needed to detect deserialized injected elements, that is
// element declared in patch files.
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698