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 4376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 Element element = ElementLocator.locate(node.parent); |
4397 if (element?.library?.isJS != true) { | 4397 if (element != null && element.library?.isJS != true) { |
pquitslund
2016/07/29 18:05:25
Should this be triggered if the library is null?
Brian Wilkerson
2016/07/29 18:56:22
I have no idea. The library should never be null;
| |
4398 _errorReporter.reportErrorForNode( | 4398 _errorReporter.reportErrorForNode( |
4399 HintCode.MISSING_JS_LIB_ANNOTATION, node, [element.name]); | 4399 HintCode.MISSING_JS_LIB_ANNOTATION, node, [element.name]); |
4400 } | 4400 } |
4401 } | 4401 } |
4402 } | 4402 } |
4403 | 4403 |
4404 /** | 4404 /** |
4405 * Verify that the given function [body] does not contain return statements | 4405 * Verify that the given function [body] does not contain return statements |
4406 * that both have and do not have return values. | 4406 * that both have and do not have return values. |
4407 * | 4407 * |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6455 class _InvocationCollector extends RecursiveAstVisitor { | 6455 class _InvocationCollector extends RecursiveAstVisitor { |
6456 final List<String> superCalls = <String>[]; | 6456 final List<String> superCalls = <String>[]; |
6457 | 6457 |
6458 @override | 6458 @override |
6459 visitMethodInvocation(MethodInvocation node) { | 6459 visitMethodInvocation(MethodInvocation node) { |
6460 if (node.target is SuperExpression) { | 6460 if (node.target is SuperExpression) { |
6461 superCalls.add(node.methodName.name); | 6461 superCalls.add(node.methodName.name); |
6462 } | 6462 } |
6463 } | 6463 } |
6464 } | 6464 } |
OLD | NEW |