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 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 final Program binary = dillTarget.loader.program; | 375 final Program binary = dillTarget.loader.program; |
376 if (binary != null) { | 376 if (binary != null) { |
377 libraries.addAll(binary.libraries); | 377 libraries.addAll(binary.libraries); |
378 uriToSource.addAll(binary.uriToSource); | 378 uriToSource.addAll(binary.uriToSource); |
379 } | 379 } |
380 | 380 |
381 // TODO(ahe): Remove this line. Kernel seems to generate a default line map | 381 // TODO(ahe): Remove this line. Kernel seems to generate a default line map |
382 // that used when there's no fileUri on an element. Instead, ensure all | 382 // that used when there's no fileUri on an element. Instead, ensure all |
383 // elements have a fileUri. | 383 // elements have a fileUri. |
384 uriToSource[""] = new Source(<int>[0], const <int>[]); | 384 uriToSource[""] = new Source(<int>[0], const <int>[]); |
385 Program program = new Program(libraries, uriToSource); | 385 Program program = |
| 386 new Program(libraries: libraries, uriToSource: uriToSource); |
386 if (loader.first != null) { | 387 if (loader.first != null) { |
387 Builder builder = loader.first.lookup("main", -1, null); | 388 Builder builder = loader.first.lookup("main", -1, null); |
388 if (builder is KernelProcedureBuilder) { | 389 if (builder is KernelProcedureBuilder) { |
389 program.mainMethod = builder.procedure; | 390 program.mainMethod = builder.procedure; |
390 } | 391 } |
391 } | 392 } |
392 if (errors.isEmpty || dillTarget.isLoaded) { | 393 if (errors.isEmpty || dillTarget.isLoaded) { |
393 runLinkTransformations(program); | 394 runLinkTransformations(program); |
394 } | 395 } |
395 ticker.logMs("Linked program"); | 396 ticker.logMs("Linked program"); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 } | 719 } |
719 for (Constructor constructor in superclass.constructors) { | 720 for (Constructor constructor in superclass.constructors) { |
720 if (constructor.name.name.isEmpty) { | 721 if (constructor.name.name.isEmpty) { |
721 return constructor.function.requiredParameterCount == 0 | 722 return constructor.function.requiredParameterCount == 0 |
722 ? constructor | 723 ? constructor |
723 : null; | 724 : null; |
724 } | 725 } |
725 } | 726 } |
726 return null; | 727 return null; |
727 } | 728 } |
OLD | NEW |