| OLD | NEW |
| 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 import 'dart:_internal' as internal; | |
| 6 import 'dart:convert' show JSON; | |
| 7 | |
| 8 @patch class Error { | 5 @patch class Error { |
| 9 @patch static String _objectToString(Object object) { | 6 @patch static String _objectToString(Object object) { |
| 10 return Object._toString(object); | 7 return Object._toString(object); |
| 11 } | 8 } |
| 12 | 9 |
| 13 @patch static String _stringToSafeString(String string) { | 10 @patch static String _stringToSafeString(String string) { |
| 14 return JSON.encode(string); | 11 return JSON.encode(string); |
| 15 } | 12 } |
| 16 | 13 |
| 17 @patch StackTrace get stackTrace => _stackTrace; | 14 @patch StackTrace get stackTrace => _stackTrace; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 _throwNew(receiver, memberName, invocation_type, arguments, | 196 _throwNew(receiver, memberName, invocation_type, arguments, |
| 200 argumentNames, existingArgumentNames); | 197 argumentNames, existingArgumentNames); |
| 201 } | 198 } |
| 202 } | 199 } |
| 203 | 200 |
| 204 // Remember the type from the invocation mirror or static compilation | 201 // Remember the type from the invocation mirror or static compilation |
| 205 // analysis when thrown directly with _throwNew. A negative value means | 202 // analysis when thrown directly with _throwNew. A negative value means |
| 206 // that no information is available. | 203 // that no information is available. |
| 207 final int _invocation_type; | 204 final int _invocation_type; |
| 208 | 205 |
| 206 @patch |
| 209 NoSuchMethodError(Object this._receiver, | 207 NoSuchMethodError(Object this._receiver, |
| 210 Symbol this._memberName, | 208 Symbol this._memberName, |
| 211 List this._arguments, | 209 List this._arguments, |
| 212 Map<Symbol, dynamic> this._namedArguments, | 210 Map<Symbol, dynamic> this._namedArguments, |
| 213 [List existingArgumentNames = null]) | 211 [List existingArgumentNames = null]) |
| 214 : this._existingArgumentNames = existingArgumentNames, | 212 : this._existingArgumentNames = existingArgumentNames, |
| 215 this._invocation_type = -1; | 213 this._invocation_type = -1; |
| 216 | 214 |
| 217 // This constructor seems to be called with either strings or | 215 // This constructor seems to be called with either strings or |
| 218 // values read from another NoSuchMethodError. | 216 // values read from another NoSuchMethodError. |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 return msg_buf.toString(); | 347 return msg_buf.toString(); |
| 350 } | 348 } |
| 351 } | 349 } |
| 352 | 350 |
| 353 | 351 |
| 354 class _CompileTimeError extends Error { | 352 class _CompileTimeError extends Error { |
| 355 final String _errorMsg; | 353 final String _errorMsg; |
| 356 _CompileTimeError(this._errorMsg); | 354 _CompileTimeError(this._errorMsg); |
| 357 String toString() => _errorMsg; | 355 String toString() => _errorMsg; |
| 358 } | 356 } |
| OLD | NEW |