Chromium Code Reviews| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 475 debugEvent("NoInitializers"); | 475 debugEvent("NoInitializers"); |
| 476 } | 476 } |
| 477 | 477 |
| 478 @override | 478 @override |
| 479 void endInitializers(int count, Token beginToken, Token endToken) { | 479 void endInitializers(int count, Token beginToken, Token endToken) { |
| 480 debugEvent("Initializers"); | 480 debugEvent("Initializers"); |
| 481 } | 481 } |
| 482 | 482 |
| 483 DartType _computeReturnTypeContext(MemberBuilder member) { | 483 DartType _computeReturnTypeContext(MemberBuilder member) { |
| 484 if (member is KernelProcedureBuilder) { | 484 if (member is KernelProcedureBuilder) { |
| 485 if (member.target.kind == ProcedureKind.Factory) { | |
| 486 return computeFactoryConstructorReturnType(member.target); | |
| 487 } | |
|
ahe
2017/06/01 09:10:08
I have to "steal" this :-)
| |
| 488 return member.target.function.returnType; | 485 return member.target.function.returnType; |
| 489 } else { | 486 } else { |
| 490 assert(member is KernelConstructorBuilder); | 487 assert(member is KernelConstructorBuilder); |
| 491 return null; | 488 return null; |
| 492 } | 489 } |
| 493 } | 490 } |
| 494 | 491 |
| 495 @override | 492 @override |
| 496 void finishFunction( | 493 void finishFunction( |
| 497 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { | 494 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { |
| (...skipping 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3235 if (starToken == null) { | 3232 if (starToken == null) { |
| 3236 return AsyncMarker.Async; | 3233 return AsyncMarker.Async; |
| 3237 } else { | 3234 } else { |
| 3238 assert(identical(starToken.stringValue, "*")); | 3235 assert(identical(starToken.stringValue, "*")); |
| 3239 return AsyncMarker.AsyncStar; | 3236 return AsyncMarker.AsyncStar; |
| 3240 } | 3237 } |
| 3241 } else { | 3238 } else { |
| 3242 return internalError("Unknown async modifier: $asyncToken"); | 3239 return internalError("Unknown async modifier: $asyncToken"); |
| 3243 } | 3240 } |
| 3244 } | 3241 } |
| OLD | NEW |