aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/statements/debugger/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/statements/debugger/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/statements/debugger/index.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-cn/web/javascript/reference/statements/debugger/index.html b/files/zh-cn/web/javascript/reference/statements/debugger/index.html
index e078482767..2a54579002 100644
--- a/files/zh-cn/web/javascript/reference/statements/debugger/index.html
+++ b/files/zh-cn/web/javascript/reference/statements/debugger/index.html
@@ -19,10 +19,10 @@ translation_of: Web/JavaScript/Reference/Statements/debugger
<p>下面的例子演示了一个包含 debugger 语句的函数,当函数被调用时,会尝试调用一个可用的调试器进行调试。</p>
-<pre class="brush:js language-js" style="padding: 1em 0px 1em 30px; font-size: 14px; white-space: normal; color: rgb(77, 78, 83);"><code class="language-js" style="direction: ltr; white-space: pre;"><span class="keyword token" style="color: #0077aa;">function</span> <span class="function token" style="color: #dd4a68;">potentiallyBuggyCode<span class="punctuation token" style="color: #999999;">(</span></span><span class="punctuation token" style="color: #999999;">)</span> <span class="punctuation token" style="color: #999999;">{</span>
- <span class="keyword token" style="color: #0077aa;">debugger</span><span class="punctuation token" style="color: #999999;">;</span>
- <span class="comment token" style="color: #708090;"> // do potentially buggy stuff to examine, step through, etc.
-</span><span class="punctuation token" style="color: #999999;">}</span></code></pre>
+<pre class="brush:js language-js" style="padding: 1em 0px 1em 30px; font-size: 14px; white-space: normal; color: rgb(77, 78, 83);"><code class="language-js" style="direction: ltr; white-space: pre;">function potentiallyBuggyCode() {
+ debugger;
+ // do potentially buggy stuff to examine, step through, etc.
+}</code></pre>
<p>当 debugger 被调用时, 执行暂停在 debugger 语句的位置。就像在脚本源代码中的断点一样。</p>