Chromium Code Reviews| Index: frog/leg/lib/core.dart |
| =================================================================== |
| --- frog/leg/lib/core.dart (revision 3496) |
| +++ 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; |
|
floitsch
2012/01/24 11:46:03
I don't really care but I thought that : is indent
ngeoffray
2012/01/24 12:09:39
It doesn't look consistent across our code base, b
|
| + String toString() { |
| + return "NoSuchMethodException - receiver: '$receiver'" + |
| + "function name: '$name' arguments: [$args]"; |
| + } |
| +} |
| + |
| class List<T> /* implements Iterable<T> */ { |
| static void _checkConstructorInput(n) { |