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

Side by Side Diff: compiler/java/com/google/dart/compiler/backend/js/ast/JsTry.java

Issue 9479013: Remove backends. (Closed) Base URL: https://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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 package com.google.dart.compiler.backend.js.ast;
6
7 import java.util.ArrayList;
8 import java.util.List;
9
10 /**
11 * A JavaScript <code>try</code> statement.
12 */
13 public class JsTry extends JsStatement {
14
15 private final List<JsCatch> catches = new ArrayList<JsCatch>();
16 private JsBlock finallyBlock;
17 private JsBlock tryBlock;
18
19 public JsTry() {
20 super();
21 }
22
23 public List<JsCatch> getCatches() {
24 return catches;
25 }
26
27 public JsBlock getFinallyBlock() {
28 return finallyBlock;
29 }
30
31 public JsBlock getTryBlock() {
32 return tryBlock;
33 }
34
35 public void setFinallyBlock(JsBlock block) {
36 this.finallyBlock = block;
37 }
38
39 public void setTryBlock(JsBlock block) {
40 tryBlock = block;
41 }
42
43 @Override
44 public void traverse(JsVisitor v, JsContext ctx) {
45 if (v.visit(this, ctx)) {
46 tryBlock = v.accept(tryBlock);
47 v.acceptWithInsertRemove(catches);
48 if (finallyBlock != null) {
49 finallyBlock = v.accept(finallyBlock);
50 }
51 }
52 v.endVisit(this, ctx);
53 }
54
55 @Override
56 public NodeKind getKind() {
57 return NodeKind.TRY;
58 }
59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698