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