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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user