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

Unified Diff: tests/compiler/dart2js/link_helper.dart

Issue 177963002: Use List instead of Link in the type system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 6 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 | « tests/compiler/dart2js/least_upper_bound_test.dart ('k') | tests/compiler/dart2js/link_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/link_helper.dart
diff --git a/tests/compiler/dart2js/link_helper.dart b/tests/compiler/dart2js/link_helper.dart
new file mode 100644
index 0000000000000000000000000000000000000000..efe78c38ebe2299e4b57b3a8c9da3389d4fe5120
--- /dev/null
+++ b/tests/compiler/dart2js/link_helper.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2014, 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.
+
+library link_helper;
+import '../../../sdk/lib/_internal/compiler/implementation/util/util.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/util/util_implementation.dart';
+
+Link LinkFromList(List list) {
+ switch (list.length) {
+ case 0:
+ return new Link();
+ case 1:
+ return new LinkEntry(list[0]);
+ case 2:
+ return new LinkEntry(list[0], new LinkEntry(list[1]));
+ case 3:
+ return new LinkEntry(
+ list[0], new LinkEntry(list[1], new LinkEntry(list[2])));
+ }
+ Link link = new Link();
+ for (int i = list.length; i > 0; i--) {
+ link = link.prepend(list[i - 1]);
+ }
+ return link;
+}
« no previous file with comments | « tests/compiler/dart2js/least_upper_bound_test.dart ('k') | tests/compiler/dart2js/link_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698