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 4375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4386 StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, | 4386 StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, |
4387 offset, | 4387 offset, |
4388 end - offset, | 4388 end - offset, |
4389 [constantNames[i]]); | 4389 [constantNames[i]]); |
4390 } | 4390 } |
4391 } | 4391 } |
4392 } | 4392 } |
4393 | 4393 |
4394 void _checkForMissingJSLibAnnotation(Annotation node) { | 4394 void _checkForMissingJSLibAnnotation(Annotation node) { |
4395 if (node.elementAnnotation?.isJS ?? false) { | 4395 if (node.elementAnnotation?.isJS ?? false) { |
4396 Element element = ElementLocator.locate(node.parent); | 4396 if (_currentLibrary.isJS != true) { |
pquitslund
2016/07/29 20:14:30
Is `_currentLibrary` certain to be non-null? Or d
Brian Wilkerson
2016/07/29 20:19:37
Yes. (It's a final field initialized in the constr
| |
4397 if (element?.library?.isJS != true) { | |
4398 _errorReporter.reportErrorForNode( | 4397 _errorReporter.reportErrorForNode( |
4399 HintCode.MISSING_JS_LIB_ANNOTATION, node, [element.name]); | 4398 HintCode.MISSING_JS_LIB_ANNOTATION, node); |
4400 } | 4399 } |
4401 } | 4400 } |
4402 } | 4401 } |
4403 | 4402 |
4404 /** | 4403 /** |
4405 * Verify that the given function [body] does not contain return statements | 4404 * Verify that the given function [body] does not contain return statements |
4406 * that both have and do not have return values. | 4405 * that both have and do not have return values. |
4407 * | 4406 * |
4408 * See [StaticWarningCode.MIXED_RETURN_TYPES]. | 4407 * See [StaticWarningCode.MIXED_RETURN_TYPES]. |
4409 */ | 4408 */ |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6455 class _InvocationCollector extends RecursiveAstVisitor { | 6454 class _InvocationCollector extends RecursiveAstVisitor { |
6456 final List<String> superCalls = <String>[]; | 6455 final List<String> superCalls = <String>[]; |
6457 | 6456 |
6458 @override | 6457 @override |
6459 visitMethodInvocation(MethodInvocation node) { | 6458 visitMethodInvocation(MethodInvocation node) { |
6460 if (node.target is SuperExpression) { | 6459 if (node.target is SuperExpression) { |
6461 superCalls.add(node.methodName.name); | 6460 superCalls.add(node.methodName.name); |
6462 } | 6461 } |
6463 } | 6462 } |
6464 } | 6463 } |
OLD | NEW |