Chromium Code Reviews| Index: docs/es6_chromium.md |
| diff --git a/docs/es6_chromium.md b/docs/es6_chromium.md |
| index 946a48a585393dfd2e0bc97d724debf7510cdda0..6fe94e7fa642709b7e07bfd388b83920e4211839 100644 |
| --- a/docs/es6_chromium.md |
| +++ b/docs/es6_chromium.md |
| @@ -183,6 +183,46 @@ 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**: => does not work in iOS9. Don't use it in code that runs on Chrome for |
|
PhistucK
2017/06/16 14:53:09
Remove "=>".
(Or replace with "classes")
dpapad
2017/06/16 18:09:24
Done.
|
| +iOS, unless you can verify it works. |
| + |
| +--- |
| + |
| # Banned Features |
| The following features are banned for Chromium development. |
| @@ -264,42 +304,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:** |