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

Unified Diff: docs/es6_chromium.md

Issue 2940233002: WebUI: Allow using ES6 classes in the styleguide. (Closed)
Patch Set: Resolve conflicts. 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 | « chrome/browser/resources/settings/search_settings.js ('k') | 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 946a48a585393dfd2e0bc97d724debf7510cdda0..f4a2843804b984a4485f26f7308e890488151a53 100644
--- a/docs/es6_chromium.md
+++ b/docs/es6_chromium.md
@@ -183,6 +183,47 @@ this document.
---
+## Classes
+
+OOP-style and boilerplate-free class syntax, including inheritance, `super()`,
+static members, and getters and setters.
+
+**Usage Example:**
+
+```js
+class Shape {
+ constructor(x, y) {
+ this.x = x;
+ this.y = y;
+ }
+}
+// Note: let Shape = class {...}; is also valid.
+
+class Rectangle extends Shape {
+ constructor(x, y, width, height) {
+ super(id, x, y);
+ this.width = width;
+ this.height = height;
+ }
+
+ static goldenRectangle() {
+ var PHI = (1 + Math.sqrt(5)) / 2;
+ return new Rectangle(0, 0, PHI, 1);
+ }
+}
+```
+
+**Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions)
+
+**Discussion Notes / Link to Thread:**
+https://groups.google.com/a/chromium.org/d/msg/chromium-dev/S1h-0m2ohOw/jyaiMGDlCwAJ
+
+**Note**: Not fully supported in iOS9. Don't use it in code that runs on Chrome
+for iOS, unless you can verify it works. TODO: Remove this note once support for
+iOS9 is dropped.
+
+---
+
# Banned Features
The following features are banned for Chromium development.
@@ -264,42 +305,6 @@ frobber.isFrobbing = false; // Works.
---
-## Classes
-
-OOP-style and boilerplate-free class syntax, including inheritance, `super()`,
-static members, and getters and setters.
-
-**Usage Example:**
-
-```js
-class Shape {
- constructor(x, y) {
- this.x = x;
- this.y = y;
- }
-}
-// Note: let Shape = class {...}; is also valid.
-
-class Rectangle extends Shape {
- constructor(x, y, width, height) {
- super(id, x, y);
- this.width = width;
- this.height = height;
- }
-
- static goldenRectangle() {
- var PHI = (1 + Math.sqrt(5)) / 2;
- return new Rectangle(0, 0, PHI, 1);
- }
-}
-```
-
-**Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions)
-
-**Discussion Notes / Link to Thread:**
-
----
-
## Block Scope Functions
**Usage Example:**
« no previous file with comments | « chrome/browser/resources/settings/search_settings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698