OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.kernel_target; | 5 library fasta.kernel_target; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show File, IOSink; | 9 import 'dart:io' show File, IOSink; |
10 | 10 |
11 import 'package:kernel/ast.dart' | 11 import 'package:kernel/ast.dart' |
12 show | 12 show |
13 Arguments, | 13 Arguments, |
14 AsyncMarker, | 14 AsyncMarker, |
15 Class, | 15 Class, |
16 Constructor, | 16 Constructor, |
17 DartType, | 17 DartType, |
| 18 DynamicType, |
18 EmptyStatement, | 19 EmptyStatement, |
19 Expression, | 20 Expression, |
20 ExpressionStatement, | 21 ExpressionStatement, |
21 Field, | 22 Field, |
22 FieldInitializer, | 23 FieldInitializer, |
23 FunctionNode, | 24 FunctionNode, |
24 Initializer, | 25 Initializer, |
25 InvalidInitializer, | 26 InvalidInitializer, |
26 Library, | 27 Library, |
27 Name, | 28 Name, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 program = erroneousProgram(isFullProgram); | 214 program = erroneousProgram(isFullProgram); |
214 return uri == null | 215 return uri == null |
215 ? new Future<Program>.value(program) | 216 ? new Future<Program>.value(program) |
216 : writeLinkedProgram(uri, program, isFullProgram: isFullProgram); | 217 : writeLinkedProgram(uri, program, isFullProgram: isFullProgram); |
217 } | 218 } |
218 | 219 |
219 Future<Program> writeOutline(Uri uri) async { | 220 Future<Program> writeOutline(Uri uri) async { |
220 if (loader.first == null) return null; | 221 if (loader.first == null) return null; |
221 try { | 222 try { |
222 await loader.buildOutlines(); | 223 await loader.buildOutlines(); |
| 224 loader.coreLibrary |
| 225 .becomeCoreLibrary(const DynamicType(), const VoidType()); |
| 226 dynamicType.bind(loader.coreLibrary.members["dynamic"]); |
223 loader.resolveParts(); | 227 loader.resolveParts(); |
224 loader.computeLibraryScopes(); | 228 loader.computeLibraryScopes(); |
225 loader.resolveTypes(); | 229 loader.resolveTypes(); |
226 loader.buildProgram(); | 230 loader.buildProgram(); |
227 loader.checkSemantics(); | 231 loader.checkSemantics(); |
228 List<SourceClassBuilder> sourceClasses = collectAllSourceClasses(); | 232 List<SourceClassBuilder> sourceClasses = collectAllSourceClasses(); |
229 installDefaultSupertypes(); | 233 installDefaultSupertypes(); |
230 installDefaultConstructors(sourceClasses); | 234 installDefaultConstructors(sourceClasses); |
231 loader.resolveConstructors(); | 235 loader.resolveConstructors(); |
232 loader.finishTypeVariables(objectClassBuilder); | 236 loader.finishTypeVariables(objectClassBuilder); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 } | 673 } |
670 for (Constructor constructor in superclass.constructors) { | 674 for (Constructor constructor in superclass.constructors) { |
671 if (constructor.name.name.isEmpty) { | 675 if (constructor.name.name.isEmpty) { |
672 return constructor.function.requiredParameterCount == 0 | 676 return constructor.function.requiredParameterCount == 0 |
673 ? constructor | 677 ? constructor |
674 : null; | 678 : null; |
675 } | 679 } |
676 } | 680 } |
677 return null; | 681 return null; |
678 } | 682 } |
OLD | NEW |