语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -1,23 +1,23 @@
<article id="wikiArticle">
<div></div>
<h2 id="信息">信息</h2>
<pre class="syntaxbox">InternalError: too much recursion
</pre>
<pre><code class="language-javascript">InternalError: too much recursion
</code></pre>
<h2 id="错误类型">错误类型</h2>
<p><a href="Reference/Global_Objects/InternalError" title='InternalError 对象表示出现在JavaScript引擎内部的错误。 例如 "InternalError: too much recursion"(内部错误:递归过深)。'><code>内部错误</code></a>.</p>
<h2 id="什么地方出错了">什么地方出错了?</h2>
<p>一个调用自身的函数被称作<em>递归函数</em>。一些情况下递归函数类似于一个循环都重复地执行一个代码段许多次都需要一个条件用于避免无尽循环或此处的无尽递归。当出现过于深层的递归或无尽递归时JavaScript将会抛出此错误。</p>
<h2 id="示例">示例</h2>
<p>根据递归终止的条件,该函数将递归地执行 10 次。</p>
<pre class="brush: js">function loop(x) {
<pre><code class="language-javascript">function loop(x) {
if (x &gt;= 10) // "x &gt;= 10" 是递归终止条件
return;
// 进行一些操作...
loop(x + 1); // 递归调用
}
loop(0);</pre>
loop(0);</code></pre>
<p>将递归条件设置为一个极大的数值,将不能运行:</p>
<pre class="brush: js example-bad">function loop(x) {
<pre><code class="language-js example-bad">function loop(x) {
if (x &gt;= 1000000000000)
return;
// 进行一些操作...
@@ -25,7 +25,7 @@ loop(0);</pre>
}
loop(0);
// InternalError: too much recursion</pre>
// InternalError: too much recursion</code></pre>
<h2 id="相关页面">相关页面</h2>
<ul>
<li><a class="glossaryLink" href="/en-US/docs/Glossary/Recursion" title="递归: An act of a function calling itself. Recursion is used to solve problems that contain smaller sub-problems. A recursive function can receive two inputs: a base case (ends recursion) or a recursive case (continues recursion).">递归</a></li>