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; | 9 import 'dart:io' show File; |
10 | 10 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return link(<Library>[library.library]); | 364 return link(<Library>[library.library]); |
365 } | 365 } |
366 | 366 |
367 /// Creates a program by combining [libraries] with the libraries of | 367 /// Creates a program by combining [libraries] with the libraries of |
368 /// `dillTarget.loader.program`. | 368 /// `dillTarget.loader.program`. |
369 Program link(List<Library> libraries, {CanonicalName nameRoot}) { | 369 Program link(List<Library> libraries, {CanonicalName nameRoot}) { |
370 Map<String, Source> uriToSource = | 370 Map<String, Source> uriToSource = |
371 new Map<String, Source>.from(this.uriToSource); | 371 new Map<String, Source>.from(this.uriToSource); |
372 | 372 |
373 libraries.addAll(dillTarget.loader.libraries); | 373 libraries.addAll(dillTarget.loader.libraries); |
374 // TODO(scheglov) Should we also somehow update `uriToSource`? | 374 uriToSource.addAll(dillTarget.loader.uriToSource); |
375 // uriToSource.addAll(binary.uriToSource); | |
376 | 375 |
377 // TODO(ahe): Remove this line. Kernel seems to generate a default line map | 376 // TODO(ahe): Remove this line. Kernel seems to generate a default line map |
378 // that used when there's no fileUri on an element. Instead, ensure all | 377 // that used when there's no fileUri on an element. Instead, ensure all |
379 // elements have a fileUri. | 378 // elements have a fileUri. |
380 uriToSource[""] = new Source(<int>[0], const <int>[]); | 379 uriToSource[""] = new Source(<int>[0], const <int>[]); |
381 Program program = new Program( | 380 Program program = new Program( |
382 nameRoot: nameRoot, libraries: libraries, uriToSource: uriToSource); | 381 nameRoot: nameRoot, libraries: libraries, uriToSource: uriToSource); |
383 if (loader.first != null) { | 382 if (loader.first != null) { |
384 // TODO(sigmund): do only for full program | 383 // TODO(sigmund): do only for full program |
385 Builder builder = loader.first.lookup("main", -1, null); | 384 Builder builder = loader.first.lookup("main", -1, null); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 } | 699 } |
701 for (Constructor constructor in superclass.constructors) { | 700 for (Constructor constructor in superclass.constructors) { |
702 if (constructor.name.name.isEmpty) { | 701 if (constructor.name.name.isEmpty) { |
703 return constructor.function.requiredParameterCount == 0 | 702 return constructor.function.requiredParameterCount == 0 |
704 ? constructor | 703 ? constructor |
705 : null; | 704 : null; |
706 } | 705 } |
707 } | 706 } |
708 return null; | 707 return null; |
709 } | 708 } |
OLD | NEW |