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

Unified Diff: pkg/compiler/lib/src/universe/selector.dart

Issue 2900263002: Use failedAt in more places (constants, universe) (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
Index: pkg/compiler/lib/src/universe/selector.dart
diff --git a/pkg/compiler/lib/src/universe/selector.dart b/pkg/compiler/lib/src/universe/selector.dart
index ab0ea4ec14f89c624333ade95b7f4e398789c3b0..196489c6f64dea85dbd2ee9b4dea5c65ddc6022f 100644
--- a/pkg/compiler/lib/src/universe/selector.dart
+++ b/pkg/compiler/lib/src/universe/selector.dart
@@ -67,30 +67,27 @@ class Selector {
Selector.internal(
this.kind, this.memberName, this.callStructure, this.hashCode) {
- assert(invariant(
- NO_LOCATION_SPANNABLE,
+ assert(
kind == SelectorKind.INDEX ||
(memberName != Names.INDEX_NAME &&
memberName != Names.INDEX_SET_NAME),
- message: "kind=$kind,memberName=$memberName,"
- "callStructure:$callStructure"));
- assert(invariant(
- NO_LOCATION_SPANNABLE,
+ failedAt(NO_LOCATION_SPANNABLE,
+ "kind=$kind,memberName=$memberName,callStructure:$callStructure"));
+ assert(
kind == SelectorKind.OPERATOR ||
kind == SelectorKind.INDEX ||
!isOperatorName(memberName.text) ||
memberName.text == '??',
- message: "kind=$kind,memberName=$memberName,"
- "callStructure:$callStructure"));
- assert(invariant(
- NO_LOCATION_SPANNABLE,
+ failedAt(NO_LOCATION_SPANNABLE,
+ "kind=$kind,memberName=$memberName,callStructure:$callStructure"));
+ assert(
kind == SelectorKind.CALL ||
kind == SelectorKind.GETTER ||
kind == SelectorKind.SETTER ||
isOperatorName(memberName.text) ||
memberName.text == '??',
- message: "kind=$kind,memberName=$memberName,"
- "callStructure:$callStructure"));
+ failedAt(NO_LOCATION_SPANNABLE,
+ "kind=$kind,memberName=$memberName,callStructure:$callStructure"));
}
// TODO(johnniwinther): Extract caching.

Powered by Google App Engine
This is Rietveld 408576698