| 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; | 5 import 'dart:_internal' as internal; |
| 6 import 'dart:convert' show JSON; | 6 import 'dart:convert' show JSON; |
| 7 | 7 |
| 8 patch class Error { | 8 patch class Error { |
| 9 /* patch */ static String _objectToString(Object object) { | 9 /* patch */ static String _objectToString(Object object) { |
| 10 return Object._toString(object); | 10 return Object._toString(object); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 _throwNew(receiver, memberName, invocation_type, arguments, | 179 _throwNew(receiver, memberName, invocation_type, arguments, |
| 180 argumentNames, existingArgumentNames); | 180 argumentNames, existingArgumentNames); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 // Remember the type from the invocation mirror or static compilation | 184 // Remember the type from the invocation mirror or static compilation |
| 185 // analysis when thrown directly with _throwNew. A negative value means | 185 // analysis when thrown directly with _throwNew. A negative value means |
| 186 // that no information is available. | 186 // that no information is available. |
| 187 final int _invocation_type; | 187 final int _invocation_type; |
| 188 | 188 |
| 189 NoSuchMethodError(Object this._receiver, | 189 NoSuchMethodError(this._receiver, |
| 190 Symbol this._memberName, | 190 this._memberName, |
| 191 List this._arguments, | 191 this._arguments, |
| 192 Map<Symbol, dynamic> this._namedArguments, | 192 this._namedArguments, |
| 193 [List existingArgumentNames = null]) | 193 [List existingArgumentNames = null]) |
| 194 : this._existingArgumentNames = existingArgumentNames, | 194 : this._existingArgumentNames = existingArgumentNames, |
| 195 this._invocation_type = -1; | 195 this._invocation_type = -1; |
| 196 | 196 |
| 197 // This constructor seems to be called with either strings or | 197 // This constructor seems to be called with either strings or |
| 198 // values read from another NoSuchMethodError. | 198 // values read from another NoSuchMethodError. |
| 199 NoSuchMethodError._withType(Object this._receiver, | 199 NoSuchMethodError._withType(Object this._receiver, |
| 200 /*String|Symbol*/ memberName, | 200 /*String|Symbol*/ memberName, |
| 201 this._invocation_type, | 201 int invocation_type, |
| 202 List this._arguments, | 202 List this._arguments, |
| 203 Map<dynamic, dynamic> namedArguments, | 203 Map<dynamic, dynamic> namedArguments, |
| 204 [List existingArgumentNames = null]) | 204 [List existingArgumentNames = null]) |
| 205 : this._memberName = | 205 : this._memberName = |
| 206 (memberName is String) ? new Symbol(memberName) : memberName, | 206 (memberName is String) ? new Symbol(memberName) : memberName, |
| 207 this._invocation_type = invocation_type, |
| 207 this._namedArguments = | 208 this._namedArguments = |
| 208 (namedArguments == null) | 209 (namedArguments == null) |
| 209 ? null | 210 ? null |
| 210 : new Map<Symbol, dynamic>.fromIterable( | 211 : new Map<Symbol, dynamic>.fromIterable( |
| 211 namedArguments.keys, | 212 namedArguments.keys, |
| 212 key: (k) => (k is String) ? new Symbol(k) : k, | 213 key: (k) => (k is String) ? new Symbol(k) : k, |
| 213 value: (k) => namedArguments[k]), | 214 value: (k) => namedArguments[k]), |
| 214 this._existingArgumentNames = existingArgumentNames; | 215 this._existingArgumentNames = existingArgumentNames; |
| 215 | 216 |
| 216 | 217 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 msg_buf.write( | 331 msg_buf.write( |
| 331 "NoSuchMethodError: incorrect number of arguments passed to " | 332 "NoSuchMethodError: incorrect number of arguments passed to " |
| 332 "method named '$memberName'\n" | 333 "method named '$memberName'\n" |
| 333 "Receiver: $receiver_str\n" | 334 "Receiver: $receiver_str\n" |
| 334 "Tried calling: $memberName($actualParameters)\n" | 335 "Tried calling: $memberName($actualParameters)\n" |
| 335 "Found: $memberName($formalParameters)"); | 336 "Found: $memberName($formalParameters)"); |
| 336 } | 337 } |
| 337 return msg_buf.toString(); | 338 return msg_buf.toString(); |
| 338 } | 339 } |
| 339 } | 340 } |
| OLD | NEW |