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

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

Issue 2557513008: Enable messages in asserts by default (Closed)
Patch Set: Created 4 years 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 0d6ecf83ff5ee7a4c3b5e83705b724de0a531009..25e35f73925b26ae3f167246f8f6fe281345a14d 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -296,21 +296,10 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
final bool enableSuperMixins;
/**
- * If `true`, asserts are allowed to take a second argument representing the
- * assertion failure message (see DEP 37).
- */
- final bool enableAssertMessage;
-
- /**
* Initialize a newly created error verifier.
*/
- ErrorVerifier(
- this._errorReporter,
- this._currentLibrary,
- this._typeProvider,
- this._inheritanceManager,
- this.enableSuperMixins,
- this.enableAssertMessage) {
+ ErrorVerifier(this._errorReporter, this._currentLibrary, this._typeProvider,
+ this._inheritanceManager, this.enableSuperMixins) {
this._isInSystemLibrary = _currentLibrary.source.isInSystemLibrary;
this._hasExtUri = _currentLibrary.hasExtUri;
_isEnclosingConstructorConst = false;
@@ -349,14 +338,12 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
@override
Object visitAssertInitializer(AssertInitializer node) {
_checkForNonBoolExpression(node);
- _checkAssertMessage(node);
return super.visitAssertInitializer(node);
}
@override
Object visitAssertStatement(AssertStatement node) {
_checkForNonBoolExpression(node);
- _checkAssertMessage(node);
return super.visitAssertStatement(node);
}
@@ -1302,18 +1289,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
}
/**
- * If the given [assertion] specifies a message, verify that support
- * for assertions with messages is enabled.
- */
- void _checkAssertMessage(Assertion assertion) {
- Expression expression = assertion.message;
- if (expression != null && !enableAssertMessage) {
- _errorReporter.reportErrorForNode(
- CompileTimeErrorCode.EXTRA_ARGUMENT_TO_ASSERT, expression);
- }
- }
-
- /**
* Given a list of [directives] that have the same prefix, generate an error
* if there is more than one import and any of those imports is deferred.
*
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698