dart2js cps: Logical rewriter should treat Throw as a terminator.

Because of this bug, the tree IR had a tendency to put throw
statements at the bottom of a method, even if it meant inserting
an explicit negation in a branch.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//1368963002 .
This commit is contained in:
Asger Feldthaus
2015-09-28 11:14:28 +02:00
parent e0eac1fa99
commit 3cd331cbb6
@@ -95,7 +95,8 @@ class LogicalRewriter extends RecursiveTransformer
bool isTerminator(Statement node) {
return (node is Jump || node is Return) && !isFallthrough(node) ||
(node is ExpressionStatement && node.next is Unreachable);
(node is ExpressionStatement && node.next is Unreachable) ||
node is Throw;
}
Statement visitIf(If node) {