| OLD | NEW |
| 1 part of dart.core; | 1 part of dart.core; |
| 2 | 2 |
| 3 class Error { | 3 class Error { |
| 4 Error(); | 4 Error(); |
| 5 static String safeToString(Object object) { | 5 static String safeToString(Object object) { |
| 6 if (object is num || object is bool || null == object) { | 6 if (object is num || object is bool || null == object) { |
| 7 return object.toString(); | 7 return object.toString(); |
| 8 } | 8 } |
| 9 if (object is String) { | 9 if (object is String) { |
| 10 return _stringToSafeString(object); | 10 return _stringToSafeString(object); |
| 11 } | 11 } |
| 12 return _objectToString(object); | 12 return _objectToString(object); |
| 13 } | 13 } |
| 14 @patch static String _stringToSafeString(String string) { | 14 static String _stringToSafeString(String string) { |
| 15 return ((__x14) => DDC$RT.cast(__x14, dynamic, String, "CastGeneral", | 15 return ((__x14) => DDC$RT.cast(__x14, dynamic, String, "CastGeneral", |
| 16 """line 89, column 12 of dart:core/errors.dart: """, __x14 is String, | 16 """line 89, column 12 of dart:core/errors.dart: """, __x14 is String, |
| 17 true))(jsonEncodeNative(string)); | 17 true))(jsonEncodeNative(string)); |
| 18 } | 18 } |
| 19 @patch static String _objectToString(Object object) { | 19 static String _objectToString(Object object) { |
| 20 return ((__x15) => DDC$RT.cast(__x15, dynamic, String, "CastGeneral", | 20 return ((__x15) => DDC$RT.cast(__x15, dynamic, String, "CastGeneral", |
| 21 """line 94, column 12 of dart:core/errors.dart: """, __x15 is String, | 21 """line 93, column 12 of dart:core/errors.dart: """, __x15 is String, |
| 22 true))(Primitives.objectToString(object)); | 22 true))(Primitives.objectToString(object)); |
| 23 } | 23 } |
| 24 @patch StackTrace get stackTrace => ((__x16) => DDC$RT.cast(__x16, dynamic, | 24 StackTrace get stackTrace => ((__x16) => DDC$RT.cast(__x16, dynamic, |
| 25 StackTrace, "CastGeneral", | 25 StackTrace, "CastGeneral", |
| 26 """line 98, column 32 of dart:core/errors.dart: """, __x16 is StackTrace, | 26 """line 96, column 32 of dart:core/errors.dart: """, __x16 is StackTrace, |
| 27 true))(Primitives.extractStackTrace(this)); | 27 true))(Primitives.extractStackTrace(this)); |
| 28 } | 28 } |
| 29 class AssertionError extends Error {} | 29 class AssertionError extends Error {} |
| 30 class TypeError extends AssertionError {} | 30 class TypeError extends AssertionError {} |
| 31 class CastError extends Error {} | 31 class CastError extends Error {} |
| 32 class NullThrownError extends Error { | 32 class NullThrownError extends Error { |
| 33 String toString() => "Throw of null."; | 33 String toString() => "Throw of null."; |
| 34 } | 34 } |
| 35 class ArgumentError extends Error { | 35 class ArgumentError extends Error { |
| 36 final bool _hasValue; | 36 final bool _hasValue; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 [String name, String message, int length]) = IndexError; | 84 [String name, String message, int length]) = IndexError; |
| 85 static void checkValueInInterval(int value, int minValue, int maxValue, | 85 static void checkValueInInterval(int value, int minValue, int maxValue, |
| 86 [String name, String message]) { | 86 [String name, String message]) { |
| 87 if (value < minValue || value > maxValue) { | 87 if (value < minValue || value > maxValue) { |
| 88 throw new RangeError.range(value, minValue, maxValue, name, message); | 88 throw new RangeError.range(value, minValue, maxValue, name, message); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 static void checkValidIndex(int index, var indexable, | 91 static void checkValidIndex(int index, var indexable, |
| 92 [String name, int length, String message]) { | 92 [String name, int length, String message]) { |
| 93 if (length == null) length = DDC$RT.cast(indexable.length, dynamic, int, | 93 if (length == null) length = DDC$RT.cast(indexable.length, dynamic, int, |
| 94 "CastGeneral", """line 287, column 34 of dart:core/errors.dart: """, | 94 "CastGeneral", """line 285, column 34 of dart:core/errors.dart: """, |
| 95 indexable.length is int, true); | 95 indexable.length is int, true); |
| 96 if (index < 0 || index >= length) { | 96 if (index < 0 || index >= length) { |
| 97 if (name == null) name = "index"; | 97 if (name == null) name = "index"; |
| 98 throw new RangeError.index(index, indexable, name, message, length); | 98 throw new RangeError.index(index, indexable, name, message, length); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 static void checkValidRange(int start, int end, int length, | 101 static void checkValidRange(int start, int end, int length, |
| 102 [String startName, String endName, String message]) { | 102 [String startName, String endName, String message]) { |
| 103 if (start < 0 || start > length) { | 103 if (start < 0 || start > length) { |
| 104 if (startName == null) startName = "start"; | 104 if (startName == null) startName = "start"; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 final Map<Symbol, dynamic> _namedArguments; | 168 final Map<Symbol, dynamic> _namedArguments; |
| 169 final List _existingArgumentNames; | 169 final List _existingArgumentNames; |
| 170 NoSuchMethodError(Object receiver, Symbol memberName, | 170 NoSuchMethodError(Object receiver, Symbol memberName, |
| 171 List positionalArguments, Map<Symbol, dynamic> namedArguments, | 171 List positionalArguments, Map<Symbol, dynamic> namedArguments, |
| 172 [List existingArgumentNames = null]) | 172 [List existingArgumentNames = null]) |
| 173 : _receiver = receiver, | 173 : _receiver = receiver, |
| 174 _memberName = memberName, | 174 _memberName = memberName, |
| 175 _arguments = positionalArguments, | 175 _arguments = positionalArguments, |
| 176 _namedArguments = namedArguments, | 176 _namedArguments = namedArguments, |
| 177 _existingArgumentNames = existingArgumentNames; | 177 _existingArgumentNames = existingArgumentNames; |
| 178 @patch String toString() { | 178 String toString() { |
| 179 StringBuffer sb = new StringBuffer(); | 179 StringBuffer sb = new StringBuffer(); |
| 180 int i = 0; | 180 int i = 0; |
| 181 if (_arguments != null) { | 181 if (_arguments != null) { |
| 182 for (; i < _arguments.length; i++) { | 182 for (; i < _arguments.length; i++) { |
| 183 if (i > 0) { | 183 if (i > 0) { |
| 184 sb.write(", "); | 184 sb.write(", "); |
| 185 } | 185 } |
| 186 sb.write(Error.safeToString(_arguments[i])); | 186 sb.write(Error.safeToString(_arguments[i])); |
| 187 } | 187 } |
| 188 } | 188 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 String toString() => "Stack Overflow"; | 250 String toString() => "Stack Overflow"; |
| 251 StackTrace get stackTrace => null; | 251 StackTrace get stackTrace => null; |
| 252 } | 252 } |
| 253 class CyclicInitializationError extends Error { | 253 class CyclicInitializationError extends Error { |
| 254 final String variableName; | 254 final String variableName; |
| 255 CyclicInitializationError([this.variableName]); | 255 CyclicInitializationError([this.variableName]); |
| 256 String toString() => variableName == null | 256 String toString() => variableName == null |
| 257 ? "Reading static variable during its initialization" | 257 ? "Reading static variable during its initialization" |
| 258 : "Reading static variable '$variableName' during its initialization"; | 258 : "Reading static variable '$variableName' during its initialization"; |
| 259 } | 259 } |
| OLD | NEW |