| 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 | 7 import 'dart:async' show |
| 8 Future; | 8 Future; |
| 9 | 9 |
| 10 import 'dart:io' show | 10 import 'dart:io' show |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 new KernelLibraryBuilder(uri, fileUri, loader); | 275 new KernelLibraryBuilder(uri, fileUri, loader); |
| 276 loader.first = library; | 276 loader.first = library; |
| 277 if (isFullProgram) { | 277 if (isFullProgram) { |
| 278 // If this is an outline, we shouldn't add an executable main | 278 // If this is an outline, we shouldn't add an executable main |
| 279 // method. Similarly considerations apply to separate compilation. It | 279 // method. Similarly considerations apply to separate compilation. It |
| 280 // could also make sense to add a way to mark .dill files as having | 280 // could also make sense to add a way to mark .dill files as having |
| 281 // compile-time errors. | 281 // compile-time errors. |
| 282 KernelProcedureBuilder mainBuilder = new KernelProcedureBuilder(null, 0, | 282 KernelProcedureBuilder mainBuilder = new KernelProcedureBuilder(null, 0, |
| 283 null, "main", null, null, AsyncMarker.Sync, ProcedureKind.Method, | 283 null, "main", null, null, AsyncMarker.Sync, ProcedureKind.Method, |
| 284 library, -1); | 284 library, -1); |
| 285 library.addBuilder(mainBuilder.name, mainBuilder); | 285 library.addBuilder(mainBuilder.name, mainBuilder, -1); |
| 286 mainBuilder.body = new ExpressionStatement( | 286 mainBuilder.body = new ExpressionStatement( |
| 287 new Throw(new StringLiteral("${errors.join('\n')}"))); | 287 new Throw(new StringLiteral("${errors.join('\n')}"))); |
| 288 } | 288 } |
| 289 library.build(); | 289 library.build(); |
| 290 return link(<Library>[library.library]); | 290 return link(<Library>[library.library]); |
| 291 } | 291 } |
| 292 | 292 |
| 293 /// Creates a program by combining [libraries] with the libraries of | 293 /// Creates a program by combining [libraries] with the libraries of |
| 294 /// `dillTarget.loader.program`. | 294 /// `dillTarget.loader.program`. |
| 295 Program link(List<Library> libraries) { | 295 Program link(List<Library> libraries) { |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 superclass = superclass.superclass; | 591 superclass = superclass.superclass; |
| 592 } | 592 } |
| 593 for (Constructor constructor in superclass.constructors) { | 593 for (Constructor constructor in superclass.constructors) { |
| 594 if (constructor.name.name.isEmpty) { | 594 if (constructor.name.name.isEmpty) { |
| 595 return constructor.function.requiredParameterCount == 0 ? | 595 return constructor.function.requiredParameterCount == 0 ? |
| 596 constructor : null; | 596 constructor : null; |
| 597 } | 597 } |
| 598 } | 598 } |
| 599 return null; | 599 return null; |
| 600 } | 600 } |
| OLD | NEW |