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

Unified Diff: lib/core/expect.dart

Issue 11275042: Renaming IndexOutOfRangeException to RangeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regenerated html files. Created 8 years, 1 month 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 | « lib/core/exceptions.dart ('k') | lib/core/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/expect.dart
diff --git a/lib/core/expect.dart b/lib/core/expect.dart
index adf0604666f3101ab70c40f497ce1671d2d7be1d..b26ddc53a99420b95087dcf4e30863150d3eb36d 100644
--- a/lib/core/expect.dart
+++ b/lib/core/expect.dart
@@ -264,13 +264,16 @@ class Expect {
String reason = null]) {
try {
f();
- } catch (e) {
+ } catch (e, s) {
if (check !== null) {
- Expect.isTrue(check(e));
+ if (!check(e)) {
+ String msg = reason == null ? "" : reason;
+ _fail("Expect.throws($msg): Unexpected '$e'\n$s");
+ }
}
return;
}
- String msg = _getMessage(reason);
+ String msg = reason == null ? "" : reason;
_fail('Expect.throws($msg) fails');
}
« no previous file with comments | « lib/core/exceptions.dart ('k') | lib/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698