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

Unified Diff: dart/lib/compiler/implementation/scanner/listener.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
Index: dart/lib/compiler/implementation/scanner/listener.dart
diff --git a/dart/lib/compiler/implementation/scanner/listener.dart b/dart/lib/compiler/implementation/scanner/listener.dart
index a6c8d782fc6b25030a5ae2f1e07fd673c6f15c77..cbbc89c441f1ae61c0229a1235f7846f1cdeb278 100644
--- a/dart/lib/compiler/implementation/scanner/listener.dart
+++ b/dart/lib/compiler/implementation/scanner/listener.dart
@@ -254,7 +254,7 @@ class Listener {
void handleCaseMatch(Token caseKeyword, Token colon) {
}
- void handleCatchBlock(Token catchKeyword) {
+ void handleCatchBlock(Token onKeyword, Token catchKeyword) {
}
void handleFinallyBlock(Token finallyKeyword) {
@@ -1361,10 +1361,11 @@ class NodeListener extends ElementListener {
pushNode(new CaseMatch(caseKeyword, popNode(), colon));
}
- void handleCatchBlock(Token catchKeyword) {
+ void handleCatchBlock(Token onKeyword, Token catchKeyword) {
Block block = popNode();
NodeList formals = popNode();
- pushNode(new CatchBlock(formals, block, catchKeyword));
+ TypeAnnotation type = onKeyword != null ? popNode() : null;
+ pushNode(new CatchBlock(type, formals, block, type, catchKeyword));
}
void endSwitchStatement(Token switchKeyword, Token endToken) {
« no previous file with comments | « dart/lib/compiler/implementation/scanner/keyword.dart ('k') | dart/lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698