| 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;
|
| +}
|
|
|