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) --- .../global_objects/map/@@tostringtag/index.html | 54 +--------------------- .../reference/global_objects/map/delete/index.html | 2 +- .../reference/global_objects/map/has/index.html | 50 +------------------- .../reference/global_objects/map/index.html | 18 ++++---- .../reference/global_objects/map/size/index.html | 4 +- .../reference/global_objects/map/values/index.html | 50 +------------------- 6 files changed, 16 insertions(+), 162 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/map') diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html index 186603b1a3..d74a6f0cdf 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/map/@@tostringtag/index.html @@ -49,56 +49,6 @@ browser-compat: javascript.builtins.Map.@@toStringTag -

浏览器兼容

+

浏览器兼容性

-

{{CompatibilityTable}} 

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatChrome(44.0) }}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Basic support{{ CompatNo }}{{ CompatChrome(44.0) }}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatChrome(44.0)}}
-
+{{Compat}} diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html index 6bbd943f7f..d2801c08d5 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/map/delete/index.html @@ -14,7 +14,7 @@ browser-compat: javascript.builtins.Map.delete ---
{{JSRef}}
-

 delete() 方法用于移除 Map 对象中指定的元素。

+

delete() 方法用于移除 Map 对象中指定的元素。

{{EmbedInteractiveExample("pages/js/map-prototype-delete.html")}}
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html index 461f2e5e07..0f5989851b 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/map/has/index.html @@ -64,55 +64,7 @@ myMap.has("baz"); // returns false

浏览器兼容性

-

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
浏览器Chrome谷歌Firefox (Gecko)火狐Internet ExplorerOperaSafari
兼容版本38{{CompatGeckoDesktop("13.0")}}11257.1
-
- -
- - - - - - - - - - - - - - - - - - - - - -
浏览器AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
兼容版本{{CompatNo}}38{{CompatGeckoMobile("13.0")}}{{CompatNo}}{{CompatNo}}8
-
+{{Compat}}

相关链接

diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/index.html index 675b0f1b1b..606848aabd 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/map/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/map/index.html @@ -52,8 +52,8 @@ browser-compat: javascript.builtins.Map

一个 Object 有一个原型, 原型链上的键名有可能和你自己在对象上的设置的键名产生冲突。

-
-

注意: 虽然 ES5 开始可以用 Object.create(null) 来创建一个没有原型的对象,但是这种用法不太常见。

+
+

备注:虽然 ES5 开始可以用 Object.create(null) 来创建一个没有原型的对象,但是这种用法不太常见。

@@ -70,8 +70,8 @@ browser-compat: javascript.builtins.Map

一个 Object 的键是无序的

-
-

注意:自ECMAScript 2015规范以来,对象确实保留了字符串和Symbol键的创建顺序; 因此,在只有字符串键的对象上进行迭代将按插入顺序产生键。

+
+

备注:自ECMAScript 2015规范以来,对象确实保留了字符串和Symbol键的创建顺序; 因此,在只有字符串键的对象上进行迭代将按插入顺序产生键。

@@ -238,8 +238,8 @@ console.log(clone.get(1)); // one console.log(original === clone); // false. 浅比较 不为同一个对象的引用 -
-

重要:请记住,数据本身未被克隆。

+
+

备注:请记住,数据本身未被克隆。

Map对象间可以进行合并,但是会保持键的唯一性。

@@ -289,7 +289,7 @@ console.log(merged.get(3)); // three

所以,你还是可以这样做...

-
let wrongMap = new Map()
+
let wrongMap = new Map()
 wrongMap['bla'] = 'blaa'
 wrongMap['bla2'] = 'blaaa2'
 
@@ -298,13 +298,13 @@ console.log(wrongMap)  // Map { bla: 'blaa', bla2: 'blaaa2' }
 
 

...但是,这样做的话,它的行为会不符合预期:

-
wrongMap.has('bla')    // false
+
wrongMap.has('bla')    // false
 wrongMap.delete('bla') // false
 console.log(wrongMap)  // Map { bla: 'blaa', bla2: 'blaaa2' }

无论如何,和正确用法比较起来,几乎没有什么不同: 

-
let myMap = new Map()
+
let myMap = new Map()
 myMap.set('bla','blaa')
 myMap.set('bla2','blaa2')
 console.log(myMap)  // Map { 'bla' => 'blaa', 'bla2' => 'blaa2' }
diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html
index 97a5d475c3..f793669b7b 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/map/size/index.html
@@ -62,8 +62,8 @@ myMap.size // 3
 

此页的兼容性表格请查阅:https://github.com/mdn/browser-compat-data 
如果你想更新数据,请在GitHub上给我们发推送请求。

-
-

异常提醒

+
+

警告:异常提醒

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html index 46e4de8672..c85c3bcc36 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/map/values/index.html @@ -63,55 +63,7 @@ console.log(mapIter.next().value); // "baz"

浏览器兼容性

-

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support38{{ CompatGeckoDesktop("20") }}{{CompatNo}}257.1
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}38{{ CompatGeckoMobile("20") }}{{CompatNo}}{{CompatNo}}8
-
+{{Compat}}

查看

-- cgit v1.2.3-54-g00ecf