| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index c8901236e07895d9c8ca9fe031d207ec02619afe..ce7cc4134d887170762966ec2ee2914588de325a 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -2440,6 +2440,12 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
|
| unimplemented(node, 'operator');
|
| }
|
|
|
| + visitRethrow(Rethrow node) {
|
| + if (!inCatchBlock) {
|
| + error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
|
| + }
|
| + }
|
| +
|
| visitReturn(Return node) {
|
| if (node.isRedirectingFactoryBody) {
|
| handleRedirectingFactoryBody(node);
|
| @@ -2492,12 +2498,9 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
|
| }
|
|
|
| visitThrow(Throw node) {
|
| - if (!inCatchBlock && node.expression == null) {
|
| - error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
|
| - }
|
| - // We don't know ahead of time whether we will need the throw in a statement
|
| - // context or an expression context, so we register both here, even though
|
| - // we may not need ThrowExpression.
|
| + // We don't know ahead of time whether we will need the throw in a
|
| + // statement context or an expression context, so we register both
|
| + // here, even though we may not need ThrowExpression.
|
| compiler.backend.registerWrapException(mapping);
|
| compiler.backend.registerThrowExpression(mapping);
|
| visit(node.expression);
|
|
|