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

Unified Diff: testcases/input/named_parameters.dart

Issue 2502343002: Store named parameters in sorted lists instead of using maps. (Closed)
Patch Set: Remove duplicates from named parameter lists to recover from erroneous inputs Created 4 years, 1 month 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 | « test/type_parser.dart ('k') | testcases/spec-mode/named_parameters.baseline.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testcases/input/named_parameters.dart
diff --git a/testcases/input/named_parameters.dart b/testcases/input/named_parameters.dart
new file mode 100644
index 0000000000000000000000000000000000000000..4425f6da9a381f9a439a6e1c42724d79d9d40601
--- /dev/null
+++ b/testcases/input/named_parameters.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+class Superclass {
+ foo({alpha, beta}) {}
+ bar({beta, alpha}) {}
+
+ namedCallback(callback({alpha, beta})) {}
+}
+
+class Subclass extends Superclass {
+ foo({beta, alpha}) {}
+ bar({alpha, beta}) {}
+
+ namedCallback(callback({beta, alpha})) {}
+}
+
+topLevelNamed(beta, alpha, {gamma, delta}) {}
+topLevelOptional(beta, alpha, [gamma, delta]) {}
+
+main() {
+ new Subclass().foo(beta: 1, alpha: 2);
+ new Subclass().foo(alpha: 1, beta: 2);
+ topLevelNamed(1, 2, gamma: 3, delta: 4);
+ topLevelNamed(1, 2, delta: 3, gamma: 4);
+}
« no previous file with comments | « test/type_parser.dart ('k') | testcases/spec-mode/named_parameters.baseline.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698