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

Unified Diff: sdk/lib/_internal/compiler/implementation/tree/unparser.dart

Issue 14211008: Add support for rethrow and start treating throw <expr> as an expression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use ?:. Created 7 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: sdk/lib/_internal/compiler/implementation/tree/unparser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
index 1e1b944fa2fb5a2180a5062e10210fb8821077c8..f0f0de315f8093715b0713f0d701030bee3f1b13 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
@@ -266,6 +266,10 @@ class Unparser implements Visitor {
visitIdentifier(node);
}
+ visitRethrow(Rethrow node) {
+ sb.write('rethrow;');
+ }
+
visitReturn(Return node) {
if (node.isRedirectingFactoryBody) {
sb.write(' ');
@@ -336,11 +340,8 @@ class Unparser implements Visitor {
visitThrow(Throw node) {
add(node.throwToken.value);
- if (node.expression != null) {
- sb.write(' ');
- visit(node.expression);
- }
- node.endToken.value.printOn(sb);
+ sb.write(' ');
+ visit(node.expression);
}
visitTypeAnnotation(TypeAnnotation node) {

Powered by Google App Engine
This is Rietveld 408576698