aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
index 09c0ff1c1a..72fb597281 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
@@ -23,12 +23,12 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/preventExtensions
<dl>
<dt><code>obj</code></dt>
<dd>将要变得不可扩展的对象。</dd>
- <dt>
- <h3 id="返回值">返回值</h3>
- </dt>
- <dd>已经不可扩展的对象。</dd>
</dl>
+<h3 id="返回值">返回值</h3>
+
+<p>已经不可扩展的对象。</p>
+
<h2 id="Description">描述</h2>
<p>如果一个对象可以添加新的属性,则这个对象是可扩展的。<code>Object.preventExtensions()</code>将对象标记为不再可扩展,这样它将永远不会具有它被标记为不可扩展时持有的属性之外的属性。注意,一般来说,不可扩展对象的属性可能仍然可被<em>删除</em>。尝试将新属性添加到不可扩展对象将静默失败或抛出{{jsxref("TypeError")}}(最常见的情况是{{jsxref("Functions_and_function_scope/Strict_mode", "strict mode", "", 1)}}中,但不排除其他情况)。</p>