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

Unified Diff: tests/language/closure3_test.dart

Issue 11415028: Remove NullPointerException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed VM bugs. 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: tests/language/closure3_test.dart
diff --git a/tests/language/closure3_test.dart b/tests/language/closure3_test.dart
index 812322877bf86de2122fa8be1768e98125dbeb66..c01bfc14d916a2b059421a7352682e47d41c09ab 100644
--- a/tests/language/closure3_test.dart
+++ b/tests/language/closure3_test.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Test that a NullPointerException is thrown even when an expression
+// Test that a NoSuchMethodError is thrown even when an expression
// seems to be free of side-effects.
test(x, y) {
@@ -10,11 +10,5 @@ test(x, y) {
}
main() {
- try {
- test(null, 2);
- Expect.fail('Expected NullPointerException');
- } on NullPointerException catch (ex) {
- return;
- }
- Expect.fail('Expected NullPointerException');
+ Expect.throws(() { test(null, 2); }, (e) => e is NoSuchMethodError);
}

Powered by Google App Engine
This is Rietveld 408576698