| 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 '../parser/parser.dart' show FormalParameterType, optional; | 7 import '../parser/parser.dart' show FormalParameterType, optional; |
| 8 | 8 |
| 9 import '../parser/error_kind.dart' show ErrorKind; | 9 import '../parser/error_kind.dart' show ErrorKind; |
| 10 | 10 |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 push(variable); | 1314 push(variable); |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 @override | 1317 @override |
| 1318 void endOptionalFormalParameters( | 1318 void endOptionalFormalParameters( |
| 1319 int count, Token beginToken, Token endToken) { | 1319 int count, Token beginToken, Token endToken) { |
| 1320 debugEvent("OptionalFormalParameters"); | 1320 debugEvent("OptionalFormalParameters"); |
| 1321 FormalParameterType kind = optional("{", beginToken) | 1321 FormalParameterType kind = optional("{", beginToken) |
| 1322 ? FormalParameterType.NAMED | 1322 ? FormalParameterType.NAMED |
| 1323 : FormalParameterType.POSITIONAL; | 1323 : FormalParameterType.POSITIONAL; |
| 1324 push(new OptionalFormals(kind, popList(count))); | 1324 push(new OptionalFormals(kind, popList(count) ?? [])); |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 @override | 1327 @override |
| 1328 void beginFunctionTypedFormalParameter(Token token) { | 1328 void beginFunctionTypedFormalParameter(Token token) { |
| 1329 debugEvent("beginFunctionTypedFormalParameter"); | 1329 debugEvent("beginFunctionTypedFormalParameter"); |
| 1330 functionNestingLevel++; | 1330 functionNestingLevel++; |
| 1331 } | 1331 } |
| 1332 | 1332 |
| 1333 @override | 1333 @override |
| 1334 void endFunctionTypedFormalParameter( | 1334 void endFunctionTypedFormalParameter( |
| (...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2677 } else if (node is TypeDeclarationBuilder) { | 2677 } else if (node is TypeDeclarationBuilder) { |
| 2678 return node.name; | 2678 return node.name; |
| 2679 } else if (node is PrefixBuilder) { | 2679 } else if (node is PrefixBuilder) { |
| 2680 return node.name; | 2680 return node.name; |
| 2681 } else if (node is ThisPropertyAccessor) { | 2681 } else if (node is ThisPropertyAccessor) { |
| 2682 return node.name.name; | 2682 return node.name.name; |
| 2683 } else { | 2683 } else { |
| 2684 return internalError("Unhandled: ${node.runtimeType}"); | 2684 return internalError("Unhandled: ${node.runtimeType}"); |
| 2685 } | 2685 } |
| 2686 } | 2686 } |
| OLD | NEW |