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

Unified Diff: pkg/analyzer/lib/src/dart/ast/ast.dart

Issue 2326813002: Replace and remove JavaException(s). (Closed)
Patch Set: Created 4 years, 3 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/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 6be013c362327fb74f5b658b9100e39d6bcff5b8..90928c882cbd93f187956de710d0fab93fac9f9a 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -399,7 +399,7 @@ class ArgumentListImpl extends AstNodeImpl implements ArgumentList {
void set correspondingPropagatedParameters(
List<ParameterElement> parameters) {
if (parameters != null && parameters.length != _arguments.length) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Expected ${_arguments.length} parameters, not ${parameters.length}");
}
_correspondingPropagatedParameters = parameters;
@@ -411,7 +411,7 @@ class ArgumentListImpl extends AstNodeImpl implements ArgumentList {
@override
void set correspondingStaticParameters(List<ParameterElement> parameters) {
if (parameters != null && parameters.length != _arguments.length) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Expected ${_arguments.length} parameters, not ${parameters.length}");
}
_correspondingStaticParameters = parameters;
@@ -5177,7 +5177,7 @@ class FunctionExpressionImpl extends ExpressionImpl
}
// This should never be reached because external functions must be named,
// hence either the body or the name should be non-null.
- throw new IllegalStateException("Non-external functions must have a body");
+ throw new StateError("Non-external functions must have a body");
}
@override
@@ -5201,7 +5201,7 @@ class FunctionExpressionImpl extends ExpressionImpl
}
// This should never be reached because external functions must be named,
// hence either the body or the name should be non-null.
- throw new IllegalStateException("Non-external functions must have a body");
+ throw new StateError("Non-external functions must have a body");
}
@override
@@ -9297,7 +9297,7 @@ class StringInterpolationImpl extends SingleStringLiteralImpl
@override
void _appendStringValue(StringBuffer buffer) {
- throw new IllegalArgumentException();
+ throw new ArgumentError();
}
}
@@ -9410,7 +9410,7 @@ abstract class StringLiteralImpl extends LiteralImpl implements StringLiteral {
StringBuffer buffer = new StringBuffer();
try {
_appendStringValue(buffer);
- } on IllegalArgumentException {
+ } on ArgumentError {
return null;
}
return buffer.toString();
@@ -9418,8 +9418,8 @@ abstract class StringLiteralImpl extends LiteralImpl implements StringLiteral {
/**
* Append the value of this string literal to the given [buffer]. Throw an
- * [IllegalArgumentException] if the string is not a constant string without
- * any string interpolation.
+ * [ArgumentError] if the string is not a constant string without any
+ * string interpolation.
*/
void _appendStringValue(StringBuffer buffer);
}

Powered by Google App Engine
This is Rietveld 408576698