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

Unified Diff: runtime/lib/errors_patch.dart

Issue 11712002: Remove NoSuchMethodErrorImplementation class and use NoSuchMethodError from core (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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 | « runtime/lib/error.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/errors_patch.dart
===================================================================
--- runtime/lib/errors_patch.dart (revision 16582)
+++ runtime/lib/errors_patch.dart (working copy)
@@ -8,3 +8,33 @@
}
}
+patch class NoSuchMethodError {
+ // The compiler emits a call to _throwNew when it cannot resolve a static
+ // method at compile time. The receiver is actually the literal class of the
+ // unresolved method.
+ static void _throwNew(Object receiver,
+ String memberName,
+ List arguments,
+ List argumentNames,
+ List existingArgumentNames) {
+ int numNamedArguments = argumentNames == null ? 0 : argumentNames.length;
+ int numPositionalArguments = arguments == null ? 0 : arguments.length;
+ numPositionalArguments -= numNamedArguments;
+ List positionalArguments;
+ if (numPositionalArguments == 0) {
+ positionalArguments = [];
+ } else {
+ positionalArguments = arguments.getRange(0, numPositionalArguments);
+ }
+ Map<String, dynamic> namedArguments = new Map<String, dynamic>();
+ for (int i = 0; i < numNamedArguments; i++) {
+ var arg_value = arguments[numPositionalArguments + i];
+ namedArguments[argumentNames[i]] = arg_value;
+ }
+ throw new NoSuchMethodError(receiver,
+ memberName,
+ positionalArguments,
+ namedArguments,
+ existingArgumentNames);
+ }
+}
« no previous file with comments | « runtime/lib/error.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698