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

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,9 +1,9 @@
<article id="wikiArticle">
<div></div>
<h2 id="消息">消息</h2>
<pre class="syntaxbox">TypeError: property "x" is non-configurable and can't be deleted. (Firefox)
<pre><code class="language-javascript">TypeError: property "x" is non-configurable and can't be deleted. (Firefox)
TypeError: Cannot delete property 'x' of #&lt;Object&gt; (Chrome)
</pre>
</code></pre>
<h2 id="错误类型">错误类型</h2>
<p><a href="Reference/Global_Objects/TypeError" title="TypeError类型错误 对象用来表示值的类型非预期类型时发生的错误。"><code>TypeError</code></a> 只出现在严格模式下。</p>
<h2 id="哪里有问题?">哪里有问题?</h2>
@@ -11,7 +11,7 @@ TypeError: Cannot delete property 'x' of #&lt;Object&gt; (Chrome)
<p>这个错误仅仅在<a href="/en-US/docs/Web/JavaScript/Reference/Strict_mode">严格模式</a>下出现。在非严格模式下,这个操作返回 <code>false</code></p>
<h2 id="示例">示例</h2>
<p>不可配置的属性并不特别常见,但是它们可以使用 <a href="Reference/Global_Objects/Object/defineProperty" title="Object.defineProperty() 方法会直接在一个对象上定义一个新属性,或者修改一个对象的现有属性, 并返回这个对象。"><code>Object.defineProperty()</code></a><a href="Reference/Global_Objects/Object/freeze" title="Object.freeze() 方法可以冻结一个对象,冻结指的是不能向这个对象添加新的属性,不能修改其已有属性的值,不能删除已有属性,以及不能修改该对象已有属性的可枚举性、可配置性、可写性。该方法返回被冻结的对象。"><code>Object.freeze()</code></a> 创建。</p>
<pre class="brush: js example-bad">'use strict';
<pre><code class="language-js example-bad">'use strict';
var obj = Object.freeze({name: 'Elsa', score: 157});
delete obj.score; // TypeError
@@ -23,10 +23,10 @@ delete obj.foo; // TypeError
'use strict';
var frozenArray = Object.freeze([0, 1, 2]);
frozenArray.pop(); // TypeError
</pre>
</code></pre>
<p>也有一些内建于 JavaScript 的不可配置属性。你可能会尝试删除一个数学常量。</p>
<pre class="brush: js example-bad">'use strict';
delete Math.PI; // TypeError</pre>
<pre><code class="language-js example-bad">'use strict';
delete Math.PI; // TypeError</code></pre>
<h2 id="另见">另见</h2>
<ul>
<li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/delete">delete operator</a></li>