| 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 'package:kernel/ast.dart' | 9 import 'package:kernel/ast.dart' |
| 10 show | 10 show |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 uriToSource.addAll(dillTarget.loader.uriToSource); | 364 uriToSource.addAll(dillTarget.loader.uriToSource); |
| 365 | 365 |
| 366 // TODO(ahe): Remove this line. Kernel seems to generate a default line map | 366 // TODO(ahe): Remove this line. Kernel seems to generate a default line map |
| 367 // that used when there's no fileUri on an element. Instead, ensure all | 367 // that used when there's no fileUri on an element. Instead, ensure all |
| 368 // elements have a fileUri. | 368 // elements have a fileUri. |
| 369 uriToSource[""] = new Source(<int>[0], const <int>[]); | 369 uriToSource[""] = new Source(<int>[0], const <int>[]); |
| 370 Program program = new Program( | 370 Program program = new Program( |
| 371 nameRoot: nameRoot, libraries: libraries, uriToSource: uriToSource); | 371 nameRoot: nameRoot, libraries: libraries, uriToSource: uriToSource); |
| 372 if (loader.first != null) { | 372 if (loader.first != null) { |
| 373 // TODO(sigmund): do only for full program | 373 // TODO(sigmund): do only for full program |
| 374 Builder builder = loader.first.lookup("main", -1, null); | 374 Builder builder = loader.first.exportScope.lookup("main", -1, null); |
| 375 if (builder is KernelProcedureBuilder) { | 375 if (builder is KernelProcedureBuilder) { |
| 376 program.mainMethod = builder.procedure; | 376 program.mainMethod = builder.procedure; |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 | 379 |
| 380 ticker.logMs("Linked program"); | 380 ticker.logMs("Linked program"); |
| 381 return program; | 381 return program; |
| 382 } | 382 } |
| 383 | 383 |
| 384 void installDefaultSupertypes() { | 384 void installDefaultSupertypes() { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 } | 671 } |
| 672 for (Constructor constructor in superclass.constructors) { | 672 for (Constructor constructor in superclass.constructors) { |
| 673 if (constructor.name.name.isEmpty) { | 673 if (constructor.name.name.isEmpty) { |
| 674 return constructor.function.requiredParameterCount == 0 | 674 return constructor.function.requiredParameterCount == 0 |
| 675 ? constructor | 675 ? constructor |
| 676 : null; | 676 : null; |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 return null; | 679 return null; |
| 680 } | 680 } |
| OLD | NEW |