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

Side by Side 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, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/error.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 patch class Error { 5 patch class Error {
6 /* patch */ static String _objectToString(Object object) { 6 /* patch */ static String _objectToString(Object object) {
7 return Object._toString(object); 7 return Object._toString(object);
8 } 8 }
9 } 9 }
10 10
11 patch class NoSuchMethodError {
12 // The compiler emits a call to _throwNew when it cannot resolve a static
13 // method at compile time. The receiver is actually the literal class of the
14 // unresolved method.
15 static void _throwNew(Object receiver,
16 String memberName,
17 List arguments,
18 List argumentNames,
19 List existingArgumentNames) {
20 int numNamedArguments = argumentNames == null ? 0 : argumentNames.length;
21 int numPositionalArguments = arguments == null ? 0 : arguments.length;
22 numPositionalArguments -= numNamedArguments;
23 List positionalArguments;
24 if (numPositionalArguments == 0) {
25 positionalArguments = [];
26 } else {
27 positionalArguments = arguments.getRange(0, numPositionalArguments);
28 }
29 Map<String, dynamic> namedArguments = new Map<String, dynamic>();
30 for (int i = 0; i < numNamedArguments; i++) {
31 var arg_value = arguments[numPositionalArguments + i];
32 namedArguments[argumentNames[i]] = arg_value;
33 }
34 throw new NoSuchMethodError(receiver,
35 memberName,
36 positionalArguments,
37 namedArguments,
38 existingArgumentNames);
39 }
40 }
OLDNEW
« 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