From d44f5032d0f53256b2d5aef505d6b593fd3cd158 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:14:18 +0800 Subject: fix yari h2m dry run errors (zh-CN) --- .../javascript/reference/global_objects/function/name/index.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/function/name') diff --git a/files/zh-cn/web/javascript/reference/global_objects/function/name/index.html b/files/zh-cn/web/javascript/reference/global_objects/function/name/index.html index 0f7695c49e..7d0557c5a4 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/function/name/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/function/name/index.html @@ -10,12 +10,12 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Function/name ---
{{JSRef("Global_Objects", "Function")}}
-
function.name 属性返回函数实例的名称。
+
function.name 属性返回函数实例的名称。

{{js_property_attributes(0,0,1)}}

-

请注意,在非标准的ES2015之前的实现中,configurable属性也是false 。

+

备注:在非标准的ES2015之前的实现中,configurable属性也是false 。

示例

@@ -184,7 +184,6 @@ if (b.constructor.name === 'Foo') {

在未压缩版本中,程序运行到真实分支并打印'foo' is an instance of 'Foo'。 而在压缩版本中,它的行为不同,并且进入else分支。如果您依赖于Function.name,就像上面的示例一样,确保您的构建管道不会更改函数名称,也不要假定函数具有特定的名称。

-

规范

@@ -210,4 +209,3 @@ if (b.constructor.name === 'Foo') {

浏览器兼容性

{{Compat("javascript.builtins.Function.name")}}

- -- cgit v1.2.3-54-g00ecf