|
19 | 19 | import com.google.javascript.rhino.Node; |
20 | 20 |
|
21 | 21 | /** |
22 | | - * {@link CheckDebuggerStatement} checks for the presence of the "debugger" |
23 | | - * statement in JavaScript code. It is appropriate to use this statement while |
24 | | - * developing JavaScript; however, it is generally undesirable to include it in |
25 | | - * production code. |
| 22 | + * {@link CheckDebuggerStatement} checks for the presence of the "debugger" statement in JavaScript |
| 23 | + * code. It is appropriate to use this statement while developing JavaScript; however, it is |
| 24 | + * generally undesirable to include it in production code. |
26 | 25 | */ |
27 | | -class CheckDebuggerStatement extends AbstractPostOrderCallback |
28 | | - implements CompilerPass { |
| 26 | +class CheckDebuggerStatement extends AbstractPostOrderCallback implements CompilerPass { |
29 | 27 |
|
30 | 28 | static final DiagnosticType DEBUGGER_STATEMENT_PRESENT = |
31 | | - DiagnosticType.disabled("JSC_DEBUGGER_STATEMENT_PRESENT", |
32 | | - "Using the debugger statement can halt your application if the user " + |
33 | | - "has a JavaScript debugger running."); |
| 29 | + DiagnosticType.disabled( |
| 30 | + "JSC_DEBUGGER_STATEMENT_PRESENT", |
| 31 | + "Using the debugger statement can halt your application if the user has a JavaScript" |
| 32 | + + " debugger running.\n" |
| 33 | + + "To disable this check when you want to do debugging, you can suppress this message" |
| 34 | + + " like this:\n" |
| 35 | + // NOTE: Single quotes around curly braces are necessary to prevent them being |
| 36 | + // interpreted as a placeholder for replacement. See MessageFormat javadoc. |
| 37 | + + " /** @suppress '{'checkDebuggerStatement'}' */\n" |
| 38 | + + " debugger;"); |
34 | 39 |
|
35 | 40 | private final AbstractCompiler compiler; |
36 | 41 |
|
|
0 commit comments