Chromium Code Reviews| Index: frog/leg/ssa/codegen.dart |
| =================================================================== |
| --- frog/leg/ssa/codegen.dart (revision 4076) |
| +++ frog/leg/ssa/codegen.dart (working copy) |
| @@ -356,23 +356,20 @@ |
| indent++; |
| List<HBasicBlock> successors = node.block.successors; |
| visitBasicBlock(successors[0]); |
| - indent--; |
| if (node.finallyBlock != successors[1]) { |
| + indent--; |
|
floitsch
2012/02/09 15:06:57
add comment that this is the catch part.
floitsch
2012/02/09 15:06:57
I would move the indent-- out of the if.
ngeoffray
2012/02/09 15:13:48
Done.
ngeoffray
2012/02/09 15:13:48
Done.
|
| addIndentation(); |
| - buffer.add('} catch (e) {\n'); |
| + String name = temporary(node.exception); |
| + parameterNames[node.exception.element] = name; |
| + buffer.add('} catch ($name) {\n'); |
| indent++; |
| + visitBasicBlock(successors[1]); |
| + parameterNames.remove(node.exception.element); |
| } |
| - for (int i = 1; i < successors.length - 1; i++) { |
| - // TODO(ngeoffray): add the type check. |
| - visitBasicBlock(successors[i]); |
| - } |
| - |
| - if (node.finallyBlock == null) { |
| - // TODO(ngeoffray): add the type check. |
| - visitBasicBlock(successors[successors.length - 1]); |
| - } else { |
| + if (node.finallyBlock != null) { |
| + indent--; |
| addIndentation(); |
| buffer.add('} finally {\n'); |
| indent++; |
| @@ -799,11 +796,11 @@ |
| buffer.add('true'); |
| } |
| } else { |
| - buffer.add('(('); |
| + buffer.add('(!!('); |
| use(node.expression); |
| buffer.add(').'); |
| buffer.add(compiler.namer.operatorIs(node.typeExpression)); |
| - buffer.add(' === true)'); |
| + buffer.add(')'); |
| } |
| } |
| } |