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

Unified Diff: pkg/compiler/lib/src/diagnostics/invariant.dart

Issue 2897093002: Revert "dart2js: replace 'invariant' with 'failedAt' to defer interpolation" (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 | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/diagnostics/invariant.dart
diff --git a/pkg/compiler/lib/src/diagnostics/invariant.dart b/pkg/compiler/lib/src/diagnostics/invariant.dart
index 34a9f3e9ffaefbc15e246ea8f466cc643906b487..7ad6f3580a0070cd7febe9c6e03aac04c6817b53 100644
--- a/pkg/compiler/lib/src/diagnostics/invariant.dart
+++ b/pkg/compiler/lib/src/diagnostics/invariant.dart
@@ -44,7 +44,7 @@ bool invariant(Spannable spannable, var condition, {var message: null}) {
// information on assertion errors.
if (spannable == null) {
throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE,
- 'Spannable was null for invariant. Use CURRENT_ELEMENT_SPANNABLE.');
+ "Spannable was null for invariant. Use CURRENT_ELEMENT_SPANNABLE.");
}
if (condition is Function) {
condition = condition();
@@ -62,28 +62,4 @@ bool invariant(Spannable spannable, var condition, {var message: null}) {
return true;
}
-/// Throws a [SpannableAssertionFailure].
-///
-/// Use this method to provide better information for assertion by calling
-/// [failedAt] as the second argument to an `assert` statement:
-///
-/// assert(condition, failedAt(position, message));
-///
-/// [spannable] must be non-null and will be used to provide positional
-/// information in the generated error message.
-bool failedAt(Spannable spannable, [var message]) {
- // TODO(johnniwinther): Use [spannable] and [message] to provide better
- // information on assertion errors.
- if (spannable == null) {
- throw new SpannableAssertionFailure(
- CURRENT_ELEMENT_SPANNABLE,
- 'Spannable was null for failedInvariant. '
- 'Use CURRENT_ELEMENT_SPANNABLE.');
- }
- if (message is Function) {
- message = message();
- }
- throw new SpannableAssertionFailure(spannable, message);
-}
-
typedef void InternalErrorFunction(Spannable location, String message);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698