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

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

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // We used to always nullify the element type of a list we are tracing in 5 // We used to always nullify the element type of a list we are tracing in
6 // the presence of a fixed length list constructor call. 6 // the presence of a fixed length list constructor call.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import "../../async_helper.dart";
9 import 10 import
10 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' 11 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'
11 show ContainerTypeMask, TypeMask; 12 show ContainerTypeMask, TypeMask;
12 13
13 import 'compiler_helper.dart'; 14 import 'compiler_helper.dart';
14 import 'parser_helper.dart'; 15 import 'parser_helper.dart';
15 16
16 17
17 const String TEST = r''' 18 const String TEST = r'''
18 var myList = [42]; 19 var myList = [42];
19 main() { 20 main() {
20 var a = new List(42); 21 var a = new List(42);
21 return myList[0]; 22 return myList[0];
22 } 23 }
23 '''; 24 ''';
24 25
25 void main() { 26 void main() {
26 Uri uri = new Uri(scheme: 'source'); 27 Uri uri = new Uri(scheme: 'source');
27 var compiler = compilerFor(TEST, uri); 28 var compiler = compilerFor(TEST, uri);
28 compiler.runCompiler(uri); 29 asyncTest(() => compiler.runCompiler(uri).then((_) {
29 var typesInferrer = compiler.typesTask.typesInferrer; 30 var typesInferrer = compiler.typesTask.typesInferrer;
30 31
31 checkType(String name, type) { 32 checkType(String name, type) {
32 var element = findElement(compiler, name); 33 var element = findElement(compiler, name);
33 ContainerTypeMask mask = typesInferrer.getTypeOfElement(element); 34 ContainerTypeMask mask = typesInferrer.getTypeOfElement(element);
34 Expect.equals(type, mask.elementType.simplify(compiler), name); 35 Expect.equals(type, mask.elementType.simplify(compiler), name);
35 } 36 }
36 37
37 checkType('myList', compiler.typesTask.intType); 38 checkType('myList', compiler.typesTask.intType);
39 }));
38 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698