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

COVERAGE SUMMARY FOR SOURCE FILE [DebuggerStmt.java]

nameclass, %method, %block, %line, %
DebuggerStmt.java100% (1/1)83%  (5/6)94%  (29/31)90%  (9/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DebuggerStmt100% (1/1)83%  (5/6)94%  (29/31)90%  (9/10)
DebuggerStmt (FilePosition): void 100% (1/1)100% (5/5)100% (1/1)
DebuggerStmt (FilePosition, Void, List): void 100% (1/1)100% (5/5)100% (2/2)
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% (11/11)100% (4/4)
toJsonML (): JsonML 100% (1/1)100% (6/6)100% (1/1)

1// Copyright (C) 2008 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.reporting.RenderContext;
18import com.google.caja.lexer.FilePosition;
19import com.google.caja.lexer.TokenConsumer;
20import com.google.caja.parser.ParseTreeNode;
21import com.google.javascript.jscomp.jsonml.JsonML;
22import com.google.javascript.jscomp.jsonml.TagType;
23 
24import java.util.List;
25 
26/**
27 * A statement that is a noop in normal execution, but will trigger a breakpoint
28 * if a debugger is attached.
29 *
30 * @author mikesamuel@gmail.com
31 */
32public final class DebuggerStmt extends AbstractStatement {
33  /**
34   * This ctor is provided for reflection.
35   * @param value unused.
36   * @param children unused.
37   */
38  @ReflectiveCtor
39  public DebuggerStmt(
40      FilePosition pos, Void value, List<? extends ParseTreeNode> children) {
41    super(pos, NoChildren.class);
42  }
43 
44  public DebuggerStmt(FilePosition pos) { super(pos, NoChildren.class); }
45 
46  @Override
47  public Object getValue() { return null; }
48 
49  public void render(RenderContext rc) {
50    TokenConsumer out = rc.getOut();
51    out.mark(getFilePosition());
52    out.consume("debugger");
53  }
54 
55  public boolean hasHangingConditional() { return false; }
56 
57  public JsonML toJsonML() {
58    return JsonMLBuilder.builder(TagType.DebuggerStmt, getFilePosition())
59        .build();
60  }
61}

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