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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 returnType: const VoidType()); | 499 returnType: const VoidType()); |
500 SuperInitializer initializer = new SuperInitializer( | 500 SuperInitializer initializer = new SuperInitializer( |
501 constructor, new Arguments(positional, named: named)); | 501 constructor, new Arguments(positional, named: named)); |
502 return new Constructor(function, | 502 return new Constructor(function, |
503 name: constructor.name, initializers: <Initializer>[initializer]); | 503 name: constructor.name, initializers: <Initializer>[initializer]); |
504 } | 504 } |
505 | 505 |
506 Constructor makeDefaultConstructor() { | 506 Constructor makeDefaultConstructor() { |
507 return new Constructor( | 507 return new Constructor( |
508 new FunctionNode(new EmptyStatement(), returnType: const VoidType()), | 508 new FunctionNode(new EmptyStatement(), returnType: const VoidType()), |
509 name: new Name("")); | 509 name: new Name(""), |
| 510 isSyntheticDefault: true); |
510 } | 511 } |
511 | 512 |
512 void finishAllConstructors() { | 513 void finishAllConstructors() { |
513 Class objectClass = this.objectClass; | 514 Class objectClass = this.objectClass; |
514 for (SourceClassBuilder builder in collectAllSourceClasses()) { | 515 for (SourceClassBuilder builder in collectAllSourceClasses()) { |
515 Class cls = builder.target; | 516 Class cls = builder.target; |
516 if (cls != objectClass) { | 517 if (cls != objectClass) { |
517 finishConstructors(builder); | 518 finishConstructors(builder); |
518 } | 519 } |
519 } | 520 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 } | 656 } |
656 for (Constructor constructor in superclass.constructors) { | 657 for (Constructor constructor in superclass.constructors) { |
657 if (constructor.name.name.isEmpty) { | 658 if (constructor.name.name.isEmpty) { |
658 return constructor.function.requiredParameterCount == 0 | 659 return constructor.function.requiredParameterCount == 0 |
659 ? constructor | 660 ? constructor |
660 : null; | 661 : null; |
661 } | 662 } |
662 } | 663 } |
663 return null; | 664 return null; |
664 } | 665 } |
OLD | NEW |