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

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 comments Created 7 years, 3 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..1c9797ca0a1b60c96625165d55aaa87a86e8a9a3 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.
- * 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 the receiver is `null`, it is interpreted as a call to a top-level
+ * function of a library.
+ *
+ * The [memberName] is a [Symbol] representing the name of the called method
+ * 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