Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: docs/es6_chromium.md

Issue 2965543002: Move Map/Set to allowed features of ES6 styleguide. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/es6_chromium.md
diff --git a/docs/es6_chromium.md b/docs/es6_chromium.md
index f4a2843804b984a4485f26f7308e890488151a53..e38e0712e5512c675282fa2b806d24aba77a43d6 100644
--- a/docs/es6_chromium.md
+++ b/docs/es6_chromium.md
@@ -110,7 +110,7 @@ and [http://es6-features.org/](http://es6-features.org/)
The following features are allowed in Chromium development.
-## `=>` (Arrow Functions)
+## => (Arrow Functions)
Arrow functions provide a concise syntax to create a function, and fix a number
of difficulties with `this` (e.g. eliminating the need to write `const self =
@@ -150,7 +150,7 @@ iOS. There's a presubmit that should warn you about this.
---
-## `Promise`
+## Promise
The Promise object is used for asynchronous computations. A Promise represents a
value which may be available now, or in the future, or never.
@@ -224,6 +224,63 @@ iOS9 is dropped.
---
+## Map
+
+A simple key/value map in which any value (both objects and primitive values)
+may be used as either a key or a value.
+
+**Usage Example:**
+
+```js
+var map = new Map();
+map.size === 0; // true
+map.get('foo'); // undefined
+
+var key = {};
michaelpg 2017/06/29 22:10:47 While you're here, I'd suggest changing the exampl
dpapad 2017/06/29 22:16:51 Done.
+map.set(key, 123);
+map.size === 1; // true
+map.has(key); // true
+map.get(key); // 123
+
+map.delete(key);
+map.has(key); // false
+map.size === 0; // true
+```
+
+**Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-map-objects)
+[link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
+
+**Discussion Notes:** Feature already extensively used prior to creation of
+this document.
+
+---
+
+## Set
+
+An object that lets you store unique values of any type, whether primitive
+values or object references.
+
+**Usage Example:**
+
+```js
+var set = new Set();
+
+set.add(123);
+set.size(); // 1
+set.has(123); // true
+
+set.add(123);
+set.size(); // 1
+```
+
+**Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-set-objects)
+[link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
+
+**Discussion Notes:** Feature already extensively used prior to creation of
+this document.
+
+---
+
# Banned Features
The following features are banned for Chromium development.
@@ -234,7 +291,7 @@ The following features are currently disallowed. See the top of this page on
how to propose moving a feature from this list into the allowed or banned
sections.
-## `let` (Block-Scoped Variables)
+## let (Block-Scoped Variables)
`let` declares a variable within the scope of a block. This differs from `var`,
which uses function level scope.
@@ -277,7 +334,7 @@ function f() {
---
-## `const` (Block-Scoped Constants)
+## const (Block-Scoped Constants)
Constants (also known as "immutable variables") are variables which cannot be
re-assigned new content. Note that if the value is an object, the object itself
@@ -619,7 +676,7 @@ Object.getOwnPropertySymbols(obj); // [foo, bar]
---
-## `for ...of` Loops
+## for...of Loops
Convenient operator to iterate over all values in an iterable collection. This
differs from `for ...in`, which iterates over all iterable properties.
@@ -781,62 +838,7 @@ for (let i of range(0, 10, 2)) {
---
-## `Map`
-
-A simple key/value map in which any value (both objects and primitive values)
-may be used as either a key or a value.
-
-**Usage Example:**
-
-```js
-var map = new Map();
-map.size === 0; // true
-map.get('foo'); // undefined
-
-var key = {};
-map.set(key, 123);
-map.size === 1; // true
-map.has(key); // true
-map.get(key); // 123
-
-map.delete(key);
-map.has(key); // false
-map.size === 0; // true
-```
-
-**Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-map-objects)
-[link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
-
-**Discussion Notes / Link to Thread:**
-
----
-
-## `Set`
-
-An object that lets you store unique values of any type, whether primitive
-values or object references.
-
-**Usage Example:**
-
-```js
-var set = new Set();
-
-set.add(123);
-set.size(); // 1
-set.has(123); // true
-
-set.add(123);
-set.size(); // 1
-```
-
-**Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-set-objects)
-[link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
-
-**Discussion Notes / Link to Thread:**
-
----
-
-## `WeakMap`
+## WeakMap
WeakMap does not prevent garbage collection if nothing else refers to an object
within the collection.
@@ -858,7 +860,7 @@ weakmap.has(key) && weakmap.get(key) === 123; // true
---
-## `WeakSet`
+## WeakSet
WeakSet does not prevent garbage collection if nothing else refers to an object
within the collection.
@@ -900,7 +902,7 @@ new UInt8ClampedArray();
---
-## `Proxy`
+## Proxy
Hooking into runtime-level object meta-operations.
@@ -932,7 +934,7 @@ keyTracker.key2; // '2 keys created!'
---
-## `Reflection`
+## Reflection
Make calls corresponding to the object meta-operations.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698