2019-04-21 11:50:48 +08:00

104 lines
5.3 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<article id="wikiArticle">
<div> <div class="blockIndicator nonStandard nonStandardHeader">
<p><strong><span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span> 非标准</strong><br/>
该特性是非标准的,请尽量不要在生产环境中使用它!</p>
</div></div>
<p><strong><code>InternalError</code> 对象</strong>表示出现在JavaScript引擎内部的错误。 例如 <strong>"InternalError</strong>: too much recursion"(内部错误:递归过深)。</p>
<h2 id="语法">语法</h2>
<pre><code class="language-javascript"><code>new InternalError([<var>message</var>[, <var>fileName</var>[, <var>lineNumber</var>]]])</code></code></pre>
<h3 id="参数">参数</h3>
<dl>
<dt><code>message</code></dt>
<dd>可选。 人类可读的错误描述信息。</dd>
<dt><code>fileName</code> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd>可选。触发该错误的代码所在文件的文件名。</dd>
<dt><code>lineNumber</code> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
<dd>可选。触发该错误的代码所在的代码行号。</dd>
</dl>
<h2 id="描述">描述</h2>
<p>当JavaScript引擎出现内部错误时将会抛出<code>InternalError。</code></p>
<p>示例场景通常为某些成分过大,例如:</p>
<ul>
<li>"too many switch cases"(过多<code>case</code>子句);</li>
<li>"too many parentheses in regular expression"(正则表达式中括号过多);</li>
<li>"array initializer too large"(数组初始化器过大);</li>
<li>"too much recursion"(递归过深)。</li>
</ul>
<h2 id="属性">属性</h2>
<dl>
<dt><a class="new" href="Reference/Global_Objects/InternalError/prototype" rel="nofollow" title="此页面仍未被本地化, 期待您的翻译!"><code>InternalError.prototype</code></a></dt>
<dd>允许向<code>InternalError</code>对象添加属性。</dd>
</dl>
<h2 id="方法">方法</h2>
<p>全局 <code>InternalError</code> 对象自身不包含任何方法,但从原型链中继承了一些方法.</p>
<h2 id="InternalError_实例"><code>InternalError</code> 实例</h2>
<h3 id="属性_2">属性</h3>
<div></div>
<h3 id="方法_2">方法</h3>
<div></div>
<h2 id="规范">规范</h2>
<p>尚未成为任何规范的一部分。</p>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<h2 id="We're_converting_our_compatibility_data_into_a_machine-readable_JSON_format._This_compatibility_table_still_uses_the_old_format_because_we_haven't_yet_converted_the_data_it_contains._Find_out_how_you_can_help!_Desktop_Mobile"><span style="font-size: 14px; font-weight: normal; line-height: 1.5;"><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
<strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
<div class="htab">
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
<ul>
<li class="selected"><a>Desktop</a></li>
<li><a>Mobile</a></li>
</ul>
</div></span></h2>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>基本支持</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>基本支持</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
</tr>
</tbody>
</table>
</div>
<h2 id="相关链接">相关链接</h2>
<ul>
<li><a href="Reference/Global_Objects/Error" title="通过Error的构造器可以创建一个错误对象。当运行时错误产生时Error的实例对象会被抛出。Error对象也可用于用户自定义的异常的基础对象。下面列出了各种内建的标准错误类型。"><code>错误</code></a></li>
<li><a class="new" href="Reference/Global_Objects/InternalError/prototype" rel="nofollow" title="此页面仍未被本地化, 期待您的翻译!"><code>InternalError.prototype</code></a></li>
</ul>
</article>