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

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: ADded RangeError.value constructor. Made VM calls work. 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
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;
floitsch 2012/11/01 12:11:39 why not just change "reason" to have a default val
Lasse Reichstein Nielsen 2012/11/01 13:39:09 I believe I have seen places where one check is ne
+ _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') | lib/html/dart2js/html_dart2js.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698