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

Unified Diff: corelib/src/exceptions.dart

Issue 10054031: Pass optional arguments to NullPointerException constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | frog/lib/natives.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/exceptions.dart
diff --git a/corelib/src/exceptions.dart b/corelib/src/exceptions.dart
index 2eba7601f414afdd8e925b59f6b6ab51ec0174fe..f318af20ccbd9b6e032a5ac330ea39fe95b9d7ba 100644
--- a/corelib/src/exceptions.dart
+++ b/corelib/src/exceptions.dart
@@ -121,21 +121,14 @@ class WrongArgumentCountException implements Exception {
class NullPointerException implements Exception {
- const NullPointerException([this.functionName, this.arguments]);
+ const NullPointerException([this.functionName, this.arguments = const []]);
String toString() {
- StringBuffer sb = new StringBuffer();
- if (arguments != null) {
- for (var arg in arguments) {
- if (!sb.isEmpty()) sb.add(", ");
- sb.add(arg);
- }
- }
if (functionName == null) {
return exceptionName;
} else {
return "$exceptionName : method: '$functionName'\n"
"Receiver: null\n"
- "Arguments: [$sb]";
+ "Arguments: $arguments";
}
}
« no previous file with comments | « no previous file | frog/lib/natives.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698