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

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

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup Created 7 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 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import 'compiler_helper.dart'; 6 import 'compiler_helper.dart';
7 7
8 const String TEST = """ 8 const String TEST = """
9 returnInt1() { 9 returnInt1() {
10 var a = 42; 10 var a = 42;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 returnInt2(); 73 returnInt2();
74 returnDyn2(); 74 returnDyn2();
75 returnInt3(); 75 returnInt3();
76 returnDyn3(); 76 returnDyn3();
77 returnInt4(); 77 returnInt4();
78 } 78 }
79 """; 79 """;
80 80
81 81
82 void main() { 82 void main() {
83 Uri uri = new Uri.fromComponents(scheme: 'source'); 83 Uri uri = new Uri(scheme: 'source');
84 var compiler = compilerFor(TEST, uri); 84 var compiler = compilerFor(TEST, uri);
85 compiler.runCompiler(uri); 85 compiler.runCompiler(uri);
86 var typesInferrer = compiler.typesTask.typesInferrer; 86 var typesInferrer = compiler.typesTask.typesInferrer;
87 87
88 checkReturn(String name, type) { 88 checkReturn(String name, type) {
89 var element = findElement(compiler, name); 89 var element = findElement(compiler, name);
90 Expect.equals(type, typesInferrer.internal.returnTypeOf[element]); 90 Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
91 } 91 }
92 92
93 checkReturn('returnInt1', typesInferrer.intType); 93 checkReturn('returnInt1', typesInferrer.intType);
94 // TODO(ngeoffray): We don't use types of mutated captured 94 // TODO(ngeoffray): We don't use types of mutated captured
95 // variables anymore, because they could lead to optimistic results 95 // variables anymore, because they could lead to optimistic results
96 // needing to be re-analyzed. 96 // needing to be re-analyzed.
97 checkReturn('returnInt2', typesInferrer.dynamicType); 97 checkReturn('returnInt2', typesInferrer.dynamicType);
98 checkReturn('returnInt3', typesInferrer.intType); 98 checkReturn('returnInt3', typesInferrer.intType);
99 checkReturn('returnInt4', typesInferrer.intType); 99 checkReturn('returnInt4', typesInferrer.intType);
100 100
101 checkReturn('returnDyn1', typesInferrer.dynamicType); 101 checkReturn('returnDyn1', typesInferrer.dynamicType);
102 checkReturn('returnDyn2', typesInferrer.dynamicType); 102 checkReturn('returnDyn2', typesInferrer.dynamicType);
103 checkReturn('returnDyn3', typesInferrer.dynamicType); 103 checkReturn('returnDyn3', typesInferrer.dynamicType);
104 } 104 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/simple_inferrer_and_or_test.dart ('k') | tests/compiler/dart2js/simple_inferrer_final_field2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698