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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/search_settings.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- Feature template markdown: 1 <!-- Feature template markdown:
2 ## Header 2 ## Header
3 3
4 **Usage Example:** 4 **Usage Example:**
5 5
6 ```js 6 ```js
7 7
8 ``` 8 ```
9 9
10 **Documentation:** [link]() 10 **Documentation:** [link]()
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 ``` 176 ```
177 177
178 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-pr omise-objects) 178 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-pr omise-objects)
179 [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_ Objects/Promise) 179 [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_ Objects/Promise)
180 180
181 **Discussion Notes:** Feature already extensively used prior to creation of 181 **Discussion Notes:** Feature already extensively used prior to creation of
182 this document. 182 this document.
183 183
184 --- 184 ---
185 185
186 ## Classes
187
188 OOP-style and boilerplate-free class syntax, including inheritance, `super()`,
189 static members, and getters and setters.
190
191 **Usage Example:**
192
193 ```js
194 class Shape {
195 constructor(x, y) {
196 this.x = x;
197 this.y = y;
198 }
199 }
200 // Note: let Shape = class {...}; is also valid.
201
202 class Rectangle extends Shape {
203 constructor(x, y, width, height) {
204 super(id, x, y);
205 this.width = width;
206 this.height = height;
207 }
208
209 static goldenRectangle() {
210 var PHI = (1 + Math.sqrt(5)) / 2;
211 return new Rectangle(0, 0, PHI, 1);
212 }
213 }
214 ```
215
216 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-cl ass-definitions)
217
218 **Discussion Notes / Link to Thread:**
219 https://groups.google.com/a/chromium.org/d/msg/chromium-dev/S1h-0m2ohOw/jyaiMGDl CwAJ
220
221 **Note**: Not fully supported in iOS9. Don't use it in code that runs on Chrome
222 for iOS, unless you can verify it works. TODO: Remove this note once support for
223 iOS9 is dropped.
224
225 ---
226
186 # Banned Features 227 # Banned Features
187 228
188 The following features are banned for Chromium development. 229 The following features are banned for Chromium development.
189 230
190 # Features To Be Discussed 231 # Features To Be Discussed
191 232
192 The following features are currently disallowed. See the top of this page on 233 The following features are currently disallowed. See the top of this page on
193 how to propose moving a feature from this list into the allowed or banned 234 how to propose moving a feature from this list into the allowed or banned
194 sections. 235 sections.
195 236
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 ``` 298 ```
258 299
259 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-le t-and-const-declarations) 300 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-le t-and-const-declarations)
260 301
261 **See also:** [Object.freeze()](https://developer.mozilla.org/en-US/docs/Web/Jav aScript/Reference/Global_Objects/Object/freeze) 302 **See also:** [Object.freeze()](https://developer.mozilla.org/en-US/docs/Web/Jav aScript/Reference/Global_Objects/Object/freeze)
262 303
263 **Discussion Notes / Link to Thread:** 304 **Discussion Notes / Link to Thread:**
264 305
265 --- 306 ---
266 307
267 ## Classes
268
269 OOP-style and boilerplate-free class syntax, including inheritance, `super()`,
270 static members, and getters and setters.
271
272 **Usage Example:**
273
274 ```js
275 class Shape {
276 constructor(x, y) {
277 this.x = x;
278 this.y = y;
279 }
280 }
281 // Note: let Shape = class {...}; is also valid.
282
283 class Rectangle extends Shape {
284 constructor(x, y, width, height) {
285 super(id, x, y);
286 this.width = width;
287 this.height = height;
288 }
289
290 static goldenRectangle() {
291 var PHI = (1 + Math.sqrt(5)) / 2;
292 return new Rectangle(0, 0, PHI, 1);
293 }
294 }
295 ```
296
297 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-cl ass-definitions)
298
299 **Discussion Notes / Link to Thread:**
300
301 ---
302
303 ## Block Scope Functions 308 ## Block Scope Functions
304 309
305 **Usage Example:** 310 **Usage Example:**
306 311
307 ```js 312 ```js
308 { 313 {
309 function foo() { 314 function foo() {
310 return 1; 315 return 1;
311 } 316 }
312 // foo() === 1 317 // foo() === 1
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 959
955 ```js 960 ```js
956 // See Doc 961 // See Doc
957 ``` 962 ```
958 963
959 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-ma th) 964 **Documentation:** [link](http://www.ecma-international.org/ecma-262/6.0/#sec-ma th)
960 965
961 **Discussion Notes / Link to Thread:** 966 **Discussion Notes / Link to Thread:**
962 967
963 --- 968 ---
OLDNEW
« 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