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

Side by Side Diff: tests/compiler/dart2js/type_test_helper.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
« no previous file with comments | « tests/compiler/dart2js/type_equals_test.dart ('k') | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library type_test_helper; 5 library type_test_helper;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; 8 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart';
9 import "parser_helper.dart" show SourceString; 9 import "parser_helper.dart" show SourceString;
10 import "compiler_helper.dart"; 10 import "compiler_helper.dart";
11 11
12 GenericType instantiate(TypeDeclarationElement element, 12 GenericType instantiate(TypeDeclarationElement element,
13 List<DartType> arguments) { 13 List<DartType> arguments) {
14 if (element.isClass()) { 14 if (element.isClass()) {
15 return new InterfaceType(element, new Link<DartType>.fromList(arguments)); 15 return new InterfaceType(element, new Link<DartType>.fromList(arguments));
16 } else { 16 } else {
17 assert(element.isTypedef()); 17 assert(element.isTypedef());
18 return new TypedefType(element, new Link<DartType>.fromList(arguments)); 18 return new TypedefType(element, new Link<DartType>.fromList(arguments));
19 } 19 }
20 } 20 }
21 21
22 class TypeEnvironment { 22 class TypeEnvironment {
23 final MockCompiler compiler; 23 final MockCompiler compiler;
24 24
25 factory TypeEnvironment(String source) { 25 factory TypeEnvironment(String source) {
26 var uri = new Uri.fromComponents(scheme: 'source'); 26 var uri = new Uri(scheme: 'source');
27 MockCompiler compiler = compilerFor(''' 27 MockCompiler compiler = compilerFor('''
28 main() {} 28 main() {}
29 $source''', 29 $source''',
30 uri, 30 uri,
31 analyzeAll: true, 31 analyzeAll: true,
32 analyzeOnly: true); 32 analyzeOnly: true);
33 compiler.runCompiler(uri); 33 compiler.runCompiler(uri);
34 return new TypeEnvironment._(compiler); 34 return new TypeEnvironment._(compiler);
35 } 35 }
36 36
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 namedParameterNames.addLast(sourceString(name)); 83 namedParameterNames.addLast(sourceString(name));
84 namedParameterTypes.addLast(type); 84 namedParameterTypes.addLast(type);
85 }); 85 });
86 } 86 }
87 FunctionType type = new FunctionType( 87 FunctionType type = new FunctionType(
88 compiler.functionClass, 88 compiler.functionClass,
89 returnType, parameterTypes, optionalParameterTypes, 89 returnType, parameterTypes, optionalParameterTypes,
90 namedParameterNames.toLink(), namedParameterTypes.toLink()); 90 namedParameterNames.toLink(), namedParameterTypes.toLink());
91 } 91 }
92 } 92 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/type_equals_test.dart ('k') | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698