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

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 1871103002: Support for @JS() validation (#26225). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: test fixes Created 4 years, 8 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; 5 library analyzer.src.generated.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode;
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 2666 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 HintCode.DEPRECATED_MEMBER_USE, 2677 HintCode.DEPRECATED_MEMBER_USE,
2678 HintCode.DUPLICATE_IMPORT, 2678 HintCode.DUPLICATE_IMPORT,
2679 HintCode.DIVISION_OPTIMIZATION, 2679 HintCode.DIVISION_OPTIMIZATION,
2680 HintCode.IS_DOUBLE, 2680 HintCode.IS_DOUBLE,
2681 HintCode.IS_INT, 2681 HintCode.IS_INT,
2682 HintCode.IS_NOT_DOUBLE, 2682 HintCode.IS_NOT_DOUBLE,
2683 HintCode.IS_NOT_INT, 2683 HintCode.IS_NOT_INT,
2684 HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, 2684 HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
2685 HintCode.INVALID_ASSIGNMENT, 2685 HintCode.INVALID_ASSIGNMENT,
2686 HintCode.INVALID_USE_OF_PROTECTED_MEMBER, 2686 HintCode.INVALID_USE_OF_PROTECTED_MEMBER,
2687 HintCode.MISSING_JS_LIB_ANNOTATION,
2687 HintCode.MISSING_REQUIRED_PARAM, 2688 HintCode.MISSING_REQUIRED_PARAM,
2688 HintCode.MISSING_RETURN, 2689 HintCode.MISSING_RETURN,
2689 HintCode.NULL_AWARE_IN_CONDITION, 2690 HintCode.NULL_AWARE_IN_CONDITION,
2690 HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, 2691 HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER,
2691 HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, 2692 HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD,
2692 HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, 2693 HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER,
2693 HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE, 2694 HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
2694 HintCode.TYPE_CHECK_IS_NOT_NULL, 2695 HintCode.TYPE_CHECK_IS_NOT_NULL,
2695 HintCode.TYPE_CHECK_IS_NULL, 2696 HintCode.TYPE_CHECK_IS_NULL,
2696 HintCode.UNDEFINED_GETTER, 2697 HintCode.UNDEFINED_GETTER,
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
3578 * Generate a hint for a constructor, function or method invocation where a 3579 * Generate a hint for a constructor, function or method invocation where a
3579 * required parameter is missing. 3580 * required parameter is missing.
3580 * 3581 *
3581 * Parameters: 3582 * Parameters:
3582 * 0: the name of the parameter 3583 * 0: the name of the parameter
3583 * 1: an optional reason 3584 * 1: an optional reason
3584 */ 3585 */
3585 static const HintCode MISSING_REQUIRED_PARAM = const HintCode( 3586 static const HintCode MISSING_REQUIRED_PARAM = const HintCode(
3586 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required. {1}"); 3587 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required. {1}");
3587 3588
3589 /**
3590 * Generate a hint for an element that is annotated with `@JS(...)` whose
3591 * library declaration is not similarly annotated.
3592 */
3593 static const HintCode MISSING_JS_LIB_ANNOTATION = const HintCode(
3594 'MISSING_JS_LIB_ANNOTATION',
3595 "The @JS() annotation can only be used if it is also declared on the libra ry directive.");
3596
3588 /** 3597 /**
3589 * Generate a hint for methods or functions that have a return type, but do 3598 * Generate a hint for methods or functions that have a return type, but do
3590 * not have a non-void return statement on all branches. At the end of methods 3599 * not have a non-void return statement on all branches. At the end of methods
3591 * or functions with no return, Dart implicitly returns `null`, avoiding these 3600 * or functions with no return, Dart implicitly returns `null`, avoiding these
3592 * implicit returns is considered a best practice. 3601 * implicit returns is considered a best practice.
3593 * 3602 *
3594 * Parameters: 3603 * Parameters:
3595 * 0: the name of the declared return type 3604 * 0: the name of the declared return type
3596 */ 3605 */
3597 static const HintCode MISSING_RETURN = const HintCode( 3606 static const HintCode MISSING_RETURN = const HintCode(
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after
5775 * Initialize a newly created error code to have the given [name]. 5784 * Initialize a newly created error code to have the given [name].
5776 */ 5785 */
5777 const TodoCode(String name) : super(name, "{0}"); 5786 const TodoCode(String name) : super(name, "{0}");
5778 5787
5779 @override 5788 @override
5780 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5789 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5781 5790
5782 @override 5791 @override
5783 ErrorType get type => ErrorType.TODO; 5792 ErrorType get type => ErrorType.TODO;
5784 } 5793 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/member.dart ('k') | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698