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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1125813004: Support 'on T' catch clauses and multiple clauses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 5252b0f04a9c175cd6def2a89af33c1f407aa0b4..47a22609d9e0b370d4fa134623f4f2a5148ccadd 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -503,15 +503,6 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
}
visitTryStatement(ast.TryStatement node) {
- // Multiple catch blocks are not yet implemented.
- if (node.catchBlocks.isEmpty ||
- !node.catchBlocks.nodes.tail.isEmpty) {
- return giveup(node, 'not exactly one catch block');
- }
- // 'on T' catch blocks are not yet implemented.
- if ((node.catchBlocks.nodes.head as ast.CatchBlock).onKeyword != null) {
- return giveup(node, '"on T" catch block');
- }
// Finally blocks are not yet implemented.
if (node.finallyBlock != null) {
return giveup(node, 'try/finally');
@@ -525,7 +516,12 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
if (catchClause.trace != null) {
stackTraceVariable = elements[catchClause.trace];
}
+ DartType type;
+ if (catchClause.onKeyword != null) {
+ type = elements.getType(catchClause.type);
+ }
catchClauseInfos.add(new CatchClauseInfo(
+ type: type,
exceptionVariable: exceptionVariable,
stackTraceVariable: stackTraceVariable,
buildCatchBlock: subbuild(catchClause.block)));

Powered by Google App Engine
This is Rietveld 408576698