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

Unified Diff: sdk/lib/core/errors.dart

Issue 23486007: Change the field and constructor parameter types of NoSuchMethodError to Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/collection/linked_hash_map.dart ('k') | sdk/lib/core/map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/errors.dart
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index 1ce7193a7d8a503baa6bcdcd6d90158a2df778da..5430cf0285e4bed91e29f1a7420f018cf91aff52 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -154,36 +154,50 @@ class AbstractClassInstantiationError extends Error {
String toString() => "Cannot instantiate abstract class: '$_className'";
}
+
/**
* Error thrown by the default implementation of [:noSuchMethod:] on [Object].
*/
class NoSuchMethodError extends Error {
final Object _receiver;
- final String _memberName;
+ final Symbol _memberName;
final List _arguments;
- final Map<String,dynamic> _namedArguments;
+ final Map<Symbol, dynamic> _namedArguments;
final List _existingArgumentNames;
/**
* Create a [NoSuchMethodError] corresponding to a failed method call.
*
- * The first parameter to this constructor is the receiver of the method call.
+ * The [receiver] is the receiver of the method call.
* That is, the object on which the method was attempted called.
floitsch 2013/08/30 15:36:44 attempted to be called.
Lasse Reichstein Nielsen 2013/09/02 09:36:29 I think the original sounds more correct, "attempt
- * The second parameter is the name of the called method or accessor.
- * The third parameter is a list of the positional arguments that the method
- * was called with.
- * The fourth parameter is a map from [String] names to the values of named
+ * If this is `null`, it is interpreted as a call to a top-level function
floitsch 2013/08/30 15:36:44 If it is `null` ... (don't use "this")
Lasse Reichstein Nielsen 2013/09/02 09:36:29 As a rule of thumb, I try to avoid "it" as well. I
+ * of a library.
+ *
+ * The [memberNamed] is a [Symbol] representing the name of the called method
floitsch 2013/08/30 15:36:44 memberName
Lasse Reichstein Nielsen 2013/09/02 09:36:29 Done.
+ * or accessor. It should not be `null`.
+ *
+ * The [positionalArguments] is a list of the positional arguments that the
+ * method was called with. If `null`, it is considered equivalent to the
+ * empty list.
+ *
+ * The [namedArguments] is a map from [Symbol]s to the values of named
* arguments that the method was called with.
+ *
* The optional [exisitingArgumentNames] is the expected parameters of a
* method with the same name on the receiver, if available. This is
- * the method that would have been called if the parameters had matched.
+ * the signature of the method that would have been called if the parameters
+ * had matched.
*/
- NoSuchMethodError(Object this._receiver,
- String this._memberName,
- List this._arguments,
- Map<String,dynamic> this._namedArguments,
+ NoSuchMethodError(Object receiver,
+ Symbol memberName,
+ List positionalArguments,
+ Map<Symbol ,dynamic> namedArguments,
[List existingArgumentNames = null])
- : this._existingArgumentNames = existingArgumentNames;
+ : _receiver = receiver,
+ _memberName = memberName,
+ _arguments = positionalArguments,
+ _namedArguments = namedArguments,
+ _existingArgumentNames = existingArgumentNames;
external String toString();
}
« no previous file with comments | « sdk/lib/collection/linked_hash_map.dart ('k') | sdk/lib/core/map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698