debugger

by 1 contributor:

This article is in need of an editorial review.

This translation is incomplete. Please help translate this article from English.

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

構文

debugger;

次の例では、関数が呼び出されるときに、(存在している場合)デバッガを呼び出すために、debugger statementが挿入されるコードを示します。

function potentiallyBuggyCode() {
    debugger;
    // do potentially buggy stuff to examine, step through, etc.
}

デバッガが呼び出されるとき、実行は、debugger statementで停止します。それは、スクリプトソースでのブレークポイントのようです。

Paused at a debugger statement.

仕様

仕様 ステータス コメント
ECMAScript第1版 標準 初期定義。
ECMAScript 5.1 (ECMA-262)
The definition of 'Debugger statement' in that specification.
Standard  
ECMAScript 6 (ECMA-262)
The definition of 'Debugger statement' in that specification.
勧告候補  

ブラウザ実装状況

機能 Chrome Firefox (Gecko) Internet Explorer Opera Safari
基本サポート (有) (有) (有) (有) (有)
機能 Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
基本サポート (有) (有) (有) (有) (有) (有)

関連情報

ドキュメントのタグと貢献者

タグ: 
Contributors to this page: shide55
最終更新者: shide55,
サイドバーを隠す