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

Unified Diff: frog/leg/lib/core.dart

Issue 9193016: Add the arity to calls, and support noSuchMethodException. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/leg/emitter.dart ('k') | frog/leg/namer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/lib/core.dart
===================================================================
--- frog/leg/lib/core.dart (revision 3539)
+++ frog/leg/lib/core.dart (working copy)
@@ -287,7 +287,22 @@
return UNINTERCEPTED(receiver.iterator());
}
+builtin$charCodeAt$1(var receiver, int index) {
+ if (JS("bool", @"typeof receiver === 'string'")) {
+ return JS("string", @"$0.charCodeAt($1)", receiver, index);
+ } else {
+ return UNINTERCEPTED(receiver.charCodeAt(index));
+ }
+}
+builtin$isEmpty$0(var receiver) {
+ if (JS("bool", @"typeof $0 === 'string'", receiver) || isJSArray(receiver)) {
+ return JS("bool", @"$0.length === 0", receiver);
+ }
+ return UNINTERCEPTED(receiver.isEmpty());
+}
+
+
bool isInt(var v) {
return JS("bool", @"($0 | 0) === $1", v, v);
}
@@ -315,7 +330,24 @@
}
return "Instance of '$name'";
}
+
+ void noSuchMethod(String name, List args) {
+ throw new NoSuchMethodException(this, name, args);
+ }
}
+
+class NoSuchMethodException {
+ Object receiver;
+ String name;
+ List args;
+ NoSuchMethodException(Object r, String n, List a)
+ : receiver = r, name = n, args = a;
+ String toString() {
+ return "NoSuchMethodException - receiver: '$receiver'" +
+ "function name: '$name' arguments: [$args]";
+ }
+}
+
class List<T> /* implements Iterable<T> */ {
static void _checkConstructorInput(n) {
« no previous file with comments | « frog/leg/emitter.dart ('k') | frog/leg/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698