| 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 eb31d04b35a448af833c5de144fc06ccb9b50730..28a6b427eee2d7fcc5af3faf10fbf7684b3dd933 100644
|
| --- a/pkg/compiler/lib/src/diagnostics/invariant.dart
|
| +++ b/pkg/compiler/lib/src/diagnostics/invariant.dart
|
| @@ -26,42 +26,6 @@ assertDebugMode(String message) {
|
| failedAt(NO_LOCATION_SPANNABLE, 'Debug mode is not enabled: $message'));
|
| }
|
|
|
| -/**
|
| - * Throws a [SpannableAssertionFailure] if [condition] is
|
| - * [:false:]. [condition] must be either a [:bool:] or a no-arg
|
| - * function returning a [:bool:].
|
| - *
|
| - * Use this method to provide better information for assertion by calling
|
| - * [invariant] as the argument to an [:assert:] statement:
|
| - *
|
| - * assert(invariant(position, isValid));
|
| - *
|
| - * [spannable] must be non-null and will be used to provide positional
|
| - * information in the generated error message.
|
| - */
|
| -bool invariant(Spannable spannable, var condition, {var message: null}) {
|
| - // 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 invariant. Use CURRENT_ELEMENT_SPANNABLE.');
|
| - }
|
| - if (condition is Function) {
|
| - condition = condition();
|
| - if (condition is String) {
|
| - message = condition;
|
| - condition = false;
|
| - }
|
| - }
|
| - if (!condition) {
|
| - if (message is Function) {
|
| - message = message();
|
| - }
|
| - throw new SpannableAssertionFailure(spannable, message);
|
| - }
|
| - return true;
|
| -}
|
| -
|
| /// Throws a [SpannableAssertionFailure].
|
| ///
|
| /// Use this method to provide better information for assertion by calling
|
| @@ -85,5 +49,3 @@ bool failedAt(Spannable spannable, [var message]) {
|
| }
|
| throw new SpannableAssertionFailure(spannable, message);
|
| }
|
| -
|
| -typedef void InternalErrorFunction(Spannable location, String message);
|
|
|