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

Unified Diff: pkg/compiler/lib/src/kernel/kernel.dart

Issue 2917653002: Use failedAt in more places (Closed)
Patch Set: 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/kernel/element_map.dart ('k') | pkg/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel.dart b/pkg/compiler/lib/src/kernel/kernel.dart
index 4e45653c41125ec58d0c7377daf73b4f5756562b..a7fd2ec95a1d935dc9d4e8d1f075fc5e41864376 100644
--- a/pkg/compiler/lib/src/kernel/kernel.dart
+++ b/pkg/compiler/lib/src/kernel/kernel.dart
@@ -707,12 +707,15 @@ class Kernel {
compiler.libraryLoader.lookupLibrary(Uris.dart_core);
ClassElement cls = library.implementation.localLookup(className);
cls.ensureResolved(compiler.resolution);
- assert(invariant(CURRENT_ELEMENT_SPANNABLE, cls != null,
- message: 'dart:core class $className not found.'));
+ assert(
+ cls != null,
+ failedAt(CURRENT_ELEMENT_SPANNABLE,
+ 'dart:core class $className not found.'));
ConstructorElement constructor = cls.lookupConstructor(constructorName);
- assert(invariant(CURRENT_ELEMENT_SPANNABLE, constructor != null,
- message: "Constructor '$constructorName' not found "
- "in class '$className'."));
+ assert(
+ constructor != null,
+ failedAt(CURRENT_ELEMENT_SPANNABLE,
+ "Constructor '$constructorName' not found in class '$className'."));
compiler.resolution.ensureResolved(constructor);
return functionToIr(constructor);
}
@@ -721,8 +724,10 @@ class Kernel {
LibraryElement library =
compiler.libraryLoader.lookupLibrary(Uris.dart_core);
Element function = library.implementation.localLookup(name);
- assert(invariant(CURRENT_ELEMENT_SPANNABLE, function != null,
- message: "dart:core method '$name' not found."));
+ assert(
+ function != null,
+ failedAt(
+ CURRENT_ELEMENT_SPANNABLE, "dart:core method '$name' not found."));
compiler.resolution.ensureResolved(function);
return functionToIr(function);
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map.dart ('k') | pkg/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698