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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« 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