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

Side by Side Diff: corelib/src/exceptions.dart

Issue 10053022: Frog has hardwired access to NullPointerException: default argument can only be null. (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Exceptions are thrown either by the VM or from Dart code. 5 // Exceptions are thrown either by the VM or from Dart code.
6 6
7 /** 7 /**
8 * Interface implemented by all core library exceptions. 8 * Interface implemented by all core library exceptions.
9 */ 9 */
10 interface Exception default ExceptionImplementation { 10 interface Exception default ExceptionImplementation {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 116
117 class WrongArgumentCountException implements Exception { 117 class WrongArgumentCountException implements Exception {
118 const WrongArgumentCountException(); 118 const WrongArgumentCountException();
119 String toString() => "WrongArgumentCountException"; 119 String toString() => "WrongArgumentCountException";
120 } 120 }
121 121
122 122
123 class NullPointerException implements Exception { 123 class NullPointerException implements Exception {
124 const NullPointerException([this.functionName, 124 const NullPointerException([this.functionName, this.arguments]);
125 this.arguments = const[]]);
126 String toString() { 125 String toString() {
127 StringBuffer sb = new StringBuffer(); 126 StringBuffer sb = new StringBuffer();
128 for (var arg in arguments) { 127 if (arguments != null) {
129 if (!sb.isEmpty()) sb.add(", "); 128 for (var arg in arguments) {
130 sb.add(arg); 129 if (!sb.isEmpty()) sb.add(", ");
130 sb.add(arg);
131 }
131 } 132 }
132 if (functionName == null) { 133 if (functionName == null) {
133 return exceptionName; 134 return exceptionName;
134 } else { 135 } else {
135 return "$exceptionName : method: '$functionName'\n" 136 return "$exceptionName : method: '$functionName'\n"
136 "Receiver: null\n" 137 "Receiver: null\n"
137 "Arguments: [$sb]"; 138 "Arguments: [$sb]";
138 } 139 }
139 } 140 }
140 141
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; 176 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'";
176 final String _pattern; 177 final String _pattern;
177 final String _errmsg; 178 final String _errmsg;
178 } 179 }
179 180
180 181
181 class IntegerDivisionByZeroException implements Exception { 182 class IntegerDivisionByZeroException implements Exception {
182 const IntegerDivisionByZeroException(); 183 const IntegerDivisionByZeroException();
183 String toString() => "IntegerDivisionByZeroException"; 184 String toString() => "IntegerDivisionByZeroException";
184 } 185 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698