Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2196483004: Check for missing elements (issue 26987) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 0a54caa945d7caa6d04eff3b93240b1e30095c02..423a58a5ba58d1c3f84ee30af33470959f676b18 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -4394,7 +4394,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
void _checkForMissingJSLibAnnotation(Annotation node) {
if (node.elementAnnotation?.isJS ?? false) {
Element element = ElementLocator.locate(node.parent);
- if (element?.library?.isJS != true) {
+ 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;
_errorReporter.reportErrorForNode(
HintCode.MISSING_JS_LIB_ANNOTATION, node, [element.name]);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | pkg/analyzer/test/generated/hint_code_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698