mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-27 01:21:38 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<h2 id="Summary" name="Summary">概述</h2>
|
||||
<p><code><strong>ReferenceError(引用错误)</strong></code> 对象代表当一个不存在的变量被引用时发生的错误。</p>
|
||||
<h2 id="Syntax" name="Syntax">语法</h2>
|
||||
<pre class="syntaxbox"><code>new ReferenceError([<var>message</var>[, <var>fileName</var>[, <var>lineNumber</var>]]])</code></pre>
|
||||
<pre><code class="language-javascript"><code>new ReferenceError([<var>message</var>[, <var>fileName</var>[, <var>lineNumber</var>]]])</code></code></pre>
|
||||
<h3 id="Parameters" name="Parameters">参数</h3>
|
||||
<dl>
|
||||
<dt><code>message</code></dt>
|
||||
@@ -44,7 +44,7 @@
|
||||
<div><p>Although the <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError" title="The ReferenceError object represents an error when a non-existent variable is referenced."><code>ReferenceError</code></a> prototype object does not contain any methods of its own, <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError" title="The ReferenceError object represents an error when a non-existent variable is referenced."><code>ReferenceError</code></a> instances do inherit some methods through the prototype chain.</p></div>
|
||||
<h2 id="Examples" name="Examples">例子</h2>
|
||||
<h3 id="Example:_Catch_an_ReferenceError" name="Example:_Catch_an_ReferenceError">例: 捕获一个 <code>ReferenceError</code></h3>
|
||||
<pre class="brush: js">try {
|
||||
<pre><code class="language-javascript">try {
|
||||
var a = undefinedVariable;
|
||||
} catch (e) {
|
||||
console.log(e instanceof ReferenceError); // true
|
||||
@@ -55,9 +55,9 @@
|
||||
console.log(e.columnNumber); // 6
|
||||
console.log(e.stack); // "@Scratchpad/2:2:7\n"
|
||||
}
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h3 id="Example:_Create_an_ReferenceError" name="Example:_Create_an_ReferenceError">例: 创建一个 <code>ReferenceError</code></h3>
|
||||
<pre class="brush: js">try {
|
||||
<pre><code class="language-javascript">try {
|
||||
throw new ReferenceError('Hello', 'someFile.js', 10);
|
||||
} catch (e) {
|
||||
console.log(e instanceof ReferenceError); // true
|
||||
@@ -68,7 +68,7 @@
|
||||
console.log(e.columnNumber); // 0
|
||||
console.log(e.stack); // "@Scratchpad/2:2:9\n"
|
||||
}
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user