EMMA Coverage Report (generated Mon Nov 01 16:48:29 PDT 2010)
[all classes][com.google.caja.parser.js]

COVERAGE SUMMARY FOR SOURCE FILE [FinallyStmt.java]

nameclass, %method, %block, %line, %
FinallyStmt.java100% (1/1)88%  (7/8)90%  (55/61)93%  (15.8/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FinallyStmt100% (1/1)88%  (7/8)90%  (55/61)93%  (15.8/17)
FinallyStmt (FilePosition, Block): void 100% (1/1)100% (8/8)100% (3/3)
FinallyStmt (FilePosition, Void, List): void 100% (1/1)100% (8/8)100% (2/2)
childrenChanged (): void 100% (1/1)79%  (15/19)94%  (3.8/4)
getBody (): Block 100% (1/1)100% (3/3)100% (1/1)
getValue (): Object 100% (1/1)100% (2/2)100% (1/1)
hasHangingConditional (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
render (RenderContext): void 100% (1/1)100% (15/15)100% (4/4)
toJsonML (): JsonML 100% (1/1)100% (4/4)100% (1/1)

1// Copyright (C) 2005 Google Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package com.google.caja.parser.js;
16 
17import com.google.caja.lexer.FilePosition;
18import com.google.caja.reporting.RenderContext;
19import com.google.javascript.jscomp.jsonml.JsonML;
20 
21import java.util.List;
22 
23/**
24 *
25 * @author mikesamuel@gmail.com
26 */
27public final class FinallyStmt extends AbstractStatement {
28  private Block body;
29 
30  /** @param value unused.  This ctor is provided for reflection. */
31  @ReflectiveCtor
32  public FinallyStmt(
33      FilePosition pos, Void value, List<? extends Block> children) {
34    this(pos, children.get(0));
35  }
36 
37  public FinallyStmt(FilePosition pos, Block body) {
38    super(pos, Block.class);
39    appendChild(body);
40  }
41 
42  public Block getBody() { return body; }
43 
44  @Override
45  protected void childrenChanged() {
46    super.childrenChanged();
47    this.body = (Block) children().get(0);
48    if (children().size() != 1) { throw new IndexOutOfBoundsException(); }
49  }
50 
51  @Override
52  public Object getValue() { return null; }
53 
54  public void render(RenderContext rc) {
55    rc.getOut().mark(getFilePosition());
56    rc.getOut().consume("finally");
57    body.renderBlock(rc, false);
58  }
59 
60  public boolean hasHangingConditional() { return false; }
61 
62  public JsonML toJsonML() { return body.toJsonML(); }
63}

[all classes][com.google.caja.parser.js]
EMMA 2.0.5312 (C) Vladimir Roubtsov