diff options
| author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:14:18 +0800 |
|---|---|---|
| committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
| commit | d44f5032d0f53256b2d5aef505d6b593fd3cd158 (patch) | |
| tree | 4b585f4be9c9a2712664ad10e7acf62c83fff51f /files/zh-cn/web/javascript/reference/strict_mode | |
| parent | f45e9e070c93ebbd83d488bdd775987a4d75c201 (diff) | |
| download | translated-content-d44f5032d0f53256b2d5aef505d6b593fd3cd158.tar.gz translated-content-d44f5032d0f53256b2d5aef505d6b593fd3cd158.tar.bz2 translated-content-d44f5032d0f53256b2d5aef505d6b593fd3cd158.zip | |
fix yari h2m dry run errors (zh-CN)
Diffstat (limited to 'files/zh-cn/web/javascript/reference/strict_mode')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/strict_mode/index.html | 6 | ||||
| -rw-r--r-- | files/zh-cn/web/javascript/reference/strict_mode/transitioning_to_strict_mode/index.html | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/files/zh-cn/web/javascript/reference/strict_mode/index.html b/files/zh-cn/web/javascript/reference/strict_mode/index.html index c4c8dbfb7d..21b45102ab 100644 --- a/files/zh-cn/web/javascript/reference/strict_mode/index.html +++ b/files/zh-cn/web/javascript/reference/strict_mode/index.html @@ -9,7 +9,9 @@ translation_of: Web/JavaScript/Reference/Strict_mode --- <div>{{JsSidebar("More")}}</div> -<div class="note">有时你会看到非严格模式,被称为“<strong><a href="https://developer.mozilla.org/docs/Glossary/Sloppy_mode" id="sloppyModeId333">sloppy mode</a></strong>”。这不是一个官方术语,但以防万一,你应该意识到这一点。</div> +<div class="note"> + <p><strong>备注:</strong>有时你会看到非严格模式,被称为“<strong><a href="https://developer.mozilla.org/docs/Glossary/Sloppy_mode">sloppy mode</a></strong>”。这不是一个官方术语,但以防万一,你应该意识到这一点。</p> +</div> <div><a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript 5</a>的<strong>严格模式</strong>是采用具有限制性JavaScript变体的一种方式,从而使代码隐式地脱离“马虎模式/稀松模式/懒散模式“(sloppy)模式。</div> @@ -112,7 +114,7 @@ delete Object.prototype; // 抛出TypeError错误 <p>第四,在Gecko版本34之前,严格模式要求一个对象内的所有属性名在对象内必须唯一。正常模式下重名属性是允许的,最后一个重名的属性决定其属性值。因为只有最后一个属性起作用,当代码要去改变属性值而不是修改最后一个重名属性的时候,复制这个对象就产生一连串的bug。在严格模式下,重名属性被认为是语法错误:</p> <div class="note"> -<p>这个问题在ECMAScript6中已经不复存在({{bug(1041128)}})。</p> +<p><strong>备注:</strong>这个问题在ECMAScript6中已经不复存在({{bug(1041128)}})。</p> </div> <pre class="brush: js">"use strict"; diff --git a/files/zh-cn/web/javascript/reference/strict_mode/transitioning_to_strict_mode/index.html b/files/zh-cn/web/javascript/reference/strict_mode/transitioning_to_strict_mode/index.html index 740a018fb9..c9675cff79 100644 --- a/files/zh-cn/web/javascript/reference/strict_mode/transitioning_to_strict_mode/index.html +++ b/files/zh-cn/web/javascript/reference/strict_mode/transitioning_to_strict_mode/index.html @@ -21,8 +21,8 @@ translation_of: Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mod <ul> <li>八进制语法<code>:var n = 023和var s = "\047"</code></li> - <li><a class="new" href="https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Statements/with" title="/zh-CN/docs/JavaScript/Reference/Statements/with"><code>with</code></a>语句</li> - <li>使用<a href="https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Operators/delete" title="/zh-CN/docs/JavaScript/Reference/Operators/delete">delete</a>删除一个变量名(而不是属性名)<code>:delete myVariable</code></li> + <li><a href="https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Statements/with" title="/zh-CN/docs/JavaScript/Reference/Statements/with"><code>with</code></a>语句</li> + <li>使用<a href="https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Operators/delete">delete</a>删除一个变量名(而不是属性名)<code>:delete myVariable</code></li> <li>使用<code>eval</code>或<code>arguments</code>作为变量名或函数名</li> <li>使用未来保留字(也许会在ECMAScript 6中使用):<code>implements</code>, <code>interface</code>, <code>let</code>, <code>package</code>, <code>private</code>, <code>protected</code>, <code>public</code>, <code>static</code>,和<code>yield</code>作为变量名或函数名</li> <li>在语句块中使用函数声明:<code>if(a<b){ function f(){} }</code></li> |
