aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/statements/debugger/index.html
blob: 5202401c7b77fa9b0c8ba11c92e2255b76905424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: debugger
slug: Web/JavaScript/Reference/Statements/debugger
tags:
  - JavaScript
  - Language feature
  - Statement
translation_of: Web/JavaScript/Reference/Statements/debugger
---
<div>{{jsSidebar("Statements")}}</div>

<p><strong><code>debugger</code></strong>は、ブレークポイントの設定のような任意の利用可能なデバッグ機能を呼び出します。デバッグ機能が利用可能ではない場合、この文は効果がありません。</p>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="syntaxbox notranslate">debugger;</pre>

<h2 id="Examples" name="Examples"></h2>

<h3 id="Using_the_debugger_statement" name="Using_the_debugger_statement">debugger 文の使用</h3>

<p>次の例は、関数が呼び出されたときに、デバッガーを (存在すれば) 呼び出すように、 <code>debugger</code> 文が挿入されているコードを示します。</p>

<pre class="brush:js notranslate">function potentiallyBuggyCode() {
    debugger;
    // do potentially buggy stuff to examine, step through, etc.
}</pre>

<p>デバッガーが起動していると、実行は <code>debugger</code> 文で停止します。スクリプトのソース内でのブレークポイントと似ています。</p>

<p><a href="https://mdn.mozillademos.org/files/6963/Screen Shot 2014-02-07 at 9.14.35 AM.png"><img alt="Paused at a debugger statement." src="https://mdn.mozillademos.org/files/6963/Screen%20Shot%202014-02-07%20at%209.14.35%20AM.png" style="height: 371px; width: 700px;"></a></p>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('ESDraft', '#sec-debugger-statement', 'Debugger statement')}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<p>{{Compat("javascript.statements.debugger")}}</p>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li><a href="/ja/docs/Mozilla/Debugging/Debugging_JavaScript">JavaScript のデバッグ</a></li>
 <li><a href="/ja/docs/Tools/Debugger">Firefox 開発者ツール内のデバッガー</a></li>
</ul>