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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 13947004: dart2js: Allow 'throw' when inlining (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Nicolas' Code review feedback Created 7 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 side-by-side diff with in-line comments
Download patch
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 ab1b7baea877ae9e110ee4b0776dbc9eadc876c8..079863eab0faf3746cde77b33683af77279994d4 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2477,7 +2477,11 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
if (!inCatchBlock && node.expression == null) {
error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
}
- compiler.backend.registerThrow(mapping);
+ // 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);
}

Powered by Google App Engine
This is Rietveld 408576698