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

Unified Diff: pkg/compiler/lib/src/serialization/serialization.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.dart
diff --git a/pkg/compiler/lib/src/serialization/serialization.dart b/pkg/compiler/lib/src/serialization/serialization.dart
index c4a9cc1403b1d6a859e1303f8deb6aa4d06be9dc..ffba5c51fb0a59375d6074ddea52838ea4b7a08f 100644
--- a/pkg/compiler/lib/src/serialization/serialization.dart
+++ b/pkg/compiler/lib/src/serialization/serialization.dart
@@ -732,13 +732,14 @@ class Serializer {
ObjectEncoder encoder = new ObjectEncoder(this, dataObject.map);
encoder.setUri(Key.URI, library.canonicalUri, library.canonicalUri);
} else if (element.isConstructor) {
- assert(invariant(
- element,
+ assert(
verifyElement(
element.enclosingClass.implementation
.lookupConstructor(element.name),
element),
- message: "Element $element is not found as a "
+ failedAt(
+ element,
+ "Element $element is not found as a "
"constructor of ${element.enclosingClass.implementation}."));
Value classId = _getElementId(element.enclosingClass);
_elementMap[element] = dataObject = new DataObject(
@@ -748,12 +749,13 @@ class Serializer {
encoder.setValue(Key.CLASS, classId);
encoder.setString(Key.NAME, element.name);
} else if (element.isClassMember) {
- assert(invariant(
- element,
+ assert(
verifyElement(
element.enclosingClass.lookupLocalMember(element.name),
element),
- message: "Element $element is not found as a "
+ failedAt(
+ element,
+ "Element $element is not found as a "
"class member of ${element.enclosingClass}."));
Value classId = _getElementId(element.enclosingClass);
_elementMap[element] = dataObject = new DataObject(
@@ -766,11 +768,12 @@ class Serializer {
encoder.setBool(Key.GETTER, element.isGetter);
}
} else {
- assert(invariant(
- element,
+ assert(
verifyElement(
element.library.implementation.find(element.name), element),
- message: "Element $element is not found as a "
+ failedAt(
+ element,
+ "Element $element is not found as a "
"library member of ${element.library.implementation}."));
Value libraryId = _getElementId(element.library);
_elementMap[element] = dataObject = new DataObject(

Powered by Google App Engine
This is Rietveld 408576698