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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 Uri uri = loader.first?.uri ?? Uri.parse("error:error"); | 324 Uri uri = loader.first?.uri ?? Uri.parse("error:error"); |
325 Uri fileUri = loader.first?.fileUri ?? uri; | 325 Uri fileUri = loader.first?.fileUri ?? uri; |
326 KernelLibraryBuilder library = | 326 KernelLibraryBuilder library = |
327 new KernelLibraryBuilder(uri, fileUri, loader, false); | 327 new KernelLibraryBuilder(uri, fileUri, loader, false); |
328 loader.first = library; | 328 loader.first = library; |
329 if (isFullProgram) { | 329 if (isFullProgram) { |
330 // If this is an outline, we shouldn't add an executable main | 330 // If this is an outline, we shouldn't add an executable main |
331 // method. Similarly considerations apply to separate compilation. It | 331 // method. Similarly considerations apply to separate compilation. It |
332 // could also make sense to add a way to mark .dill files as having | 332 // could also make sense to add a way to mark .dill files as having |
333 // compile-time errors. | 333 // compile-time errors. |
334 KernelProcedureBuilder mainBuilder = new KernelProcedureBuilder(null, 0, | 334 KernelProcedureBuilder mainBuilder = new KernelProcedureBuilder( |
335 null, "main", null, null, ProcedureKind.Method, library, -1, -1, -1); | 335 null, |
| 336 null, |
| 337 0, |
| 338 null, |
| 339 "main", |
| 340 null, |
| 341 null, |
| 342 ProcedureKind.Method, |
| 343 library, |
| 344 -1, |
| 345 -1, |
| 346 -1); |
336 library.addBuilder(mainBuilder.name, mainBuilder, -1); | 347 library.addBuilder(mainBuilder.name, mainBuilder, -1); |
337 mainBuilder.body = new Block(new List<Statement>.from(errors.map( | 348 mainBuilder.body = new Block(new List<Statement>.from(errors.map( |
338 (LocatedMessage message) => new ExpressionStatement(new Throw( | 349 (LocatedMessage message) => new ExpressionStatement(new Throw( |
339 new StringLiteral(context.format(message, Severity.error))))))); | 350 new StringLiteral(context.format(message, Severity.error))))))); |
340 } | 351 } |
341 library.build(loader.coreLibrary); | 352 library.build(loader.coreLibrary); |
342 return link(<Library>[library.library]); | 353 return link(<Library>[library.library]); |
343 } | 354 } |
344 | 355 |
345 /// Creates a program by combining [libraries] with the libraries of | 356 /// Creates a program by combining [libraries] with the libraries of |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 } | 670 } |
660 for (Constructor constructor in superclass.constructors) { | 671 for (Constructor constructor in superclass.constructors) { |
661 if (constructor.name.name.isEmpty) { | 672 if (constructor.name.name.isEmpty) { |
662 return constructor.function.requiredParameterCount == 0 | 673 return constructor.function.requiredParameterCount == 0 |
663 ? constructor | 674 ? constructor |
664 : null; | 675 : null; |
665 } | 676 } |
666 } | 677 } |
667 return null; | 678 return null; |
668 } | 679 } |
OLD | NEW |