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.body_builder; | 5 library fasta.body_builder; |
6 | 6 |
7 import '../fasta_codes.dart' | 7 import '../fasta_codes.dart' |
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; | 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; |
9 | 9 |
10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional; | 10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 debugEvent("NoInitializers"); | 478 debugEvent("NoInitializers"); |
479 } | 479 } |
480 | 480 |
481 @override | 481 @override |
482 void endInitializers(int count, Token beginToken, Token endToken) { | 482 void endInitializers(int count, Token beginToken, Token endToken) { |
483 debugEvent("Initializers"); | 483 debugEvent("Initializers"); |
484 } | 484 } |
485 | 485 |
486 DartType _computeReturnTypeContext(MemberBuilder member) { | 486 DartType _computeReturnTypeContext(MemberBuilder member) { |
487 if (member is KernelProcedureBuilder) { | 487 if (member is KernelProcedureBuilder) { |
488 if (member.target.kind == ProcedureKind.Factory) { | |
489 return computeFactoryConstructorReturnType(member.target); | |
490 } | |
491 return member.target.function.returnType; | 488 return member.target.function.returnType; |
492 } else { | 489 } else { |
493 assert(member is KernelConstructorBuilder); | 490 assert(member is KernelConstructorBuilder); |
494 return null; | 491 return null; |
495 } | 492 } |
496 } | 493 } |
497 | 494 |
498 @override | 495 @override |
499 void finishFunction( | 496 void finishFunction( |
500 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { | 497 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { |
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3278 if (starToken == null) { | 3275 if (starToken == null) { |
3279 return AsyncMarker.Async; | 3276 return AsyncMarker.Async; |
3280 } else { | 3277 } else { |
3281 assert(identical(starToken.stringValue, "*")); | 3278 assert(identical(starToken.stringValue, "*")); |
3282 return AsyncMarker.AsyncStar; | 3279 return AsyncMarker.AsyncStar; |
3283 } | 3280 } |
3284 } else { | 3281 } else { |
3285 return internalError("Unknown async modifier: $asyncToken"); | 3282 return internalError("Unknown async modifier: $asyncToken"); |
3286 } | 3283 } |
3287 } | 3284 } |
OLD | NEW |