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

Unified Diff: frog/leg/resolver.dart

Issue 9351020: Implement try/catch without finally, and without type checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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: frog/leg/resolver.dart
===================================================================
--- frog/leg/resolver.dart (revision 3986)
+++ frog/leg/resolver.dart (working copy)
@@ -844,11 +844,25 @@
}
visitTryStatement(TryStatement node) {
- compiler.unimplemented('try', node: node);
+ visit(node.tryBlock);
+ if (node.catchBlocks.isEmpty() && node.finallyBlock == null) {
+ error(node, MessageKind.NO_CATCH_NOR_FINALLY);
ahe 2012/02/07 19:10:35 The precise location here is: node.getEndToken.ne
ngeoffray 2012/02/08 09:52:23 Added a TODO because there is no API for compiler
ahe 2012/02/08 10:19:27 Please file a bug and assign it to me. Cheers, Pe
ngeoffray 2012/02/08 10:23:21 Done: http://code.google.com/p/dart/issues/detail?
ahe 2012/02/08 10:27:12 Thank you. I can see that you put the issue number
+ }
+ visit(node.catchBlocks);
+ visit(node.finallyBlock);
}
visitCatchBlock(CatchBlock node) {
- compiler.unimplemented('catch', node: node);
+ Scope scope = new BlockScope(context);
+ if (node.formals.isEmpty()) {
+ error(node, MessageKind.EMPTY_CATCH_DECLARATION);
+ } else if (!node.formals.nodes.tail.isEmpty()
+ && !node.formals.nodes.tail.tail.isEmpty()) {
+ error(node.formals.nodes.tail.tail.head,
ahe 2012/02/07 19:10:35 } else if (!node.formals.nodes.tail.isEmpty()) {
ngeoffray 2012/02/08 09:52:23 Done.
+ MessageKind.TOO_MANY_CATCH_DECLARATIONS);
+ }
+ visitIn(node.formals, scope);
+ visitIn(node.block, scope);
}
visitTypedef(Typedef node) {
« no previous file with comments | « frog/leg/frog_leg.dart ('k') | frog/leg/ssa/bailout.dart » ('j') | frog/leg/ssa/bailout.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698