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

Side by Side Diff: tests/compiler/dart2js/link_helper.dart

Issue 2647343003: Update dart2js unit tests to dart_parser and dart_scanner. (Closed)
Patch Set: Address review comments. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library link_helper; 5 library link_helper;
6 6
7 import 'package:compiler/src/util/util.dart'; 7 import 'package:compiler_util/link.dart';
8 import 'package:compiler/src/util/util_implementation.dart'; 8 import 'package:compiler_util/src/link_implementation.dart';
9 9
10 Link LinkFromList(List list) { 10 Link LinkFromList(List list) {
11 switch (list.length) { 11 switch (list.length) {
12 case 0: 12 case 0:
13 return new Link(); 13 return new Link();
14 case 1: 14 case 1:
15 return new LinkEntry(list[0]); 15 return new LinkEntry(list[0]);
16 case 2: 16 case 2:
17 return new LinkEntry(list[0], new LinkEntry(list[1])); 17 return new LinkEntry(list[0], new LinkEntry(list[1]));
18 case 3: 18 case 3:
19 return new LinkEntry( 19 return new LinkEntry(
20 list[0], new LinkEntry(list[1], new LinkEntry(list[2]))); 20 list[0], new LinkEntry(list[1], new LinkEntry(list[2])));
21 } 21 }
22 Link link = new Link(); 22 Link link = new Link();
23 for (int i = list.length; i > 0; i--) { 23 for (int i = list.length; i > 0; i--) {
24 link = link.prepend(list[i - 1]); 24 link = link.prepend(list[i - 1]);
25 } 25 }
26 return link; 26 return link;
27 } 27 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/incremental/hello_test.dart ('k') | tests/compiler/dart2js/parser_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698