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

Unified Diff: dart/lib/compiler/implementation/tree/nodes.dart

Issue 10857013: Support for new catch syntax in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 4 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
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/tree/nodes.dart
diff --git a/dart/lib/compiler/implementation/tree/nodes.dart b/dart/lib/compiler/implementation/tree/nodes.dart
index 5e68262adfa0c657bc2c623fdc801a7796ff6cdc..f3d37ec5e0467ee81f3b57eaafd24c0b0318e886 100644
--- a/dart/lib/compiler/implementation/tree/nodes.dart
+++ b/dart/lib/compiler/implementation/tree/nodes.dart
@@ -1671,12 +1671,15 @@ class CascadeReceiver extends Expression {
}
class CatchBlock extends Node {
+ final TypeAnnotation type;
final NodeList formals;
final Block block;
- final catchKeyword;
+ final Token onKeyword;
+ final Token catchKeyword;
- CatchBlock(this.formals, this.block, this.catchKeyword);
+ CatchBlock(this.type, this.formals, this.block,
+ this.onKeyword, this.catchKeyword);
CatchBlock asCatchBlock() => this;
@@ -1697,11 +1700,12 @@ class CatchBlock extends Node {
}
visitChildren(Visitor visitor) {
+ if (type != null) type.accept(visitor);
formals.accept(visitor);
block.accept(visitor);
}
- Token getBeginToken() => catchKeyword;
+ Token getBeginToken() => onKeyword != null ? onKeyword : catchKeyword;
Token getEndToken() => block.getEndToken();
}
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698