| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.generated.error_verifier; | 5 library analyzer.src.generated.error_verifier; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 5361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5372 * | 5372 * |
| 5373 * See [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]. | 5373 * See [CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER]. |
| 5374 */ | 5374 */ |
| 5375 void _checkForPrivateOptionalParameter(FormalParameter parameter) { | 5375 void _checkForPrivateOptionalParameter(FormalParameter parameter) { |
| 5376 // should be named parameter | 5376 // should be named parameter |
| 5377 if (parameter.kind != ParameterKind.NAMED) { | 5377 if (parameter.kind != ParameterKind.NAMED) { |
| 5378 return; | 5378 return; |
| 5379 } | 5379 } |
| 5380 // name should start with '_' | 5380 // name should start with '_' |
| 5381 SimpleIdentifier name = parameter.identifier; | 5381 SimpleIdentifier name = parameter.identifier; |
| 5382 if (name.isSynthetic || !StringUtilities.startsWithChar(name.name, 0x5F)) { | 5382 if (name == null || |
| 5383 name.isSynthetic || |
| 5384 !StringUtilities.startsWithChar(name.name, 0x5F)) { |
| 5383 return; | 5385 return; |
| 5384 } | 5386 } |
| 5385 | 5387 |
| 5386 _errorReporter.reportErrorForNode( | 5388 _errorReporter.reportErrorForNode( |
| 5387 CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, parameter); | 5389 CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, parameter); |
| 5388 } | 5390 } |
| 5389 | 5391 |
| 5390 /** | 5392 /** |
| 5391 * Check whether the given constructor [declaration] is the redirecting | 5393 * Check whether the given constructor [declaration] is the redirecting |
| 5392 * generative constructor and references itself directly or indirectly. The | 5394 * generative constructor and references itself directly or indirectly. The |
| (...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7157 class _InvocationCollector extends RecursiveAstVisitor { | 7159 class _InvocationCollector extends RecursiveAstVisitor { |
| 7158 final List<String> superCalls = <String>[]; | 7160 final List<String> superCalls = <String>[]; |
| 7159 | 7161 |
| 7160 @override | 7162 @override |
| 7161 visitMethodInvocation(MethodInvocation node) { | 7163 visitMethodInvocation(MethodInvocation node) { |
| 7162 if (node.target is SuperExpression) { | 7164 if (node.target is SuperExpression) { |
| 7163 superCalls.add(node.methodName.name); | 7165 superCalls.add(node.methodName.name); |
| 7164 } | 7166 } |
| 7165 } | 7167 } |
| 7166 } | 7168 } |
| OLD | NEW |