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

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

Issue 9301038: Support named arguments for statically resolved calls. (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
Index: frog/leg/lib/core.dart
===================================================================
--- frog/leg/lib/core.dart (revision 3723)
+++ frog/leg/lib/core.dart (working copy)
@@ -349,19 +349,12 @@
class List<T> /* implements Iterable<T> */ {
- static void _checkConstructorInput(n) {
- // TODO(ngeoffray): Inline once we support optional parameters or
- // bailout.
- if (!isInt(n)) throw "Invalid argument";
- if (n < 0) throw "Negative size";
+ factory List([int length]) {
+ if (length == null) return JS("Object", @"new Array()");
+ if (!isInt(length)) throw "Invalid argument";
+ if (length < 0) throw "Negative size";
+ return JS("Object", @"new Array($0)", length);
}
-
- factory List(n) {
- // TODO(ngeoffray): Adjust to optional parameters.
- if (JS("bool", @"$0 === (void 0)", n)) return JS("Object", @"new Array()");
- _checkConstructorInput(n);
- return JS("Object", @"new Array($0)", n);
- }
}
class ListIterator<T> /* implements Iterator<T> */ {
« no previous file with comments | « frog/leg/emitter.dart ('k') | frog/leg/namer.dart » ('j') | frog/leg/ssa/builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698