OLD | NEW |
1 # Catapult Style guide | 1 # Catapult Style guide |
2 | 2 |
3 ## Base style guide | 3 ## Base style guide |
4 | 4 |
5 Unless stated below, we follow the conventions listed in the [Chromium style | 5 Unless stated below, we follow the conventions listed in the [Chromium style |
6 guide](https://www.chromium.org/developers/coding-style) and [Google JavaScript | 6 guide](https://www.chromium.org/developers/coding-style) and [Google JavaScript |
7 style guide](http://google.github.io/styleguide/javascriptguide.xml). | 7 style guide](http://google.github.io/styleguide/javascriptguide.xml). |
8 | 8 |
9 ## JavaScript | 9 ## JavaScript |
10 | 10 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 **Use of ES6 features is prohibited unless explicitly approved in the table belo
w.** However, we're currently working to allow them. | 230 **Use of ES6 features is prohibited unless explicitly approved in the table belo
w.** However, we're currently working to allow them. |
231 | 231 |
232 | Feature
| Status
| | 232 | Feature
| Status
| |
233 |-------------------------------------------------------------------------------
--------------------------------------------------------------|-----------------
----------------------------------------------------------------| | 233 |-------------------------------------------------------------------------------
--------------------------------------------------------------|-----------------
----------------------------------------------------------------| |
234 | [Arrows](https://github.com/lukehoban/es6features#arrows)
| [Approved](https
://github.com/catapult-project/catapult/issues/2165) | | 234 | [Arrows](https://github.com/lukehoban/es6features#arrows)
| [Approved](https
://github.com/catapult-project/catapult/issues/2165) | |
235 | [Classes](https://github.com/lukehoban/es6features#classes)
| [Approved](https
://github.com/catapult-project/catapult/issues/2176) | | 235 | [Classes](https://github.com/lukehoban/es6features#classes)
| [Approved](https
://github.com/catapult-project/catapult/issues/2176) | |
236 | [Enhanced object literals](https://github.com/lukehoban/es6features#enhanced-o
bject-literals) | Approved
| | 236 | [Enhanced object literals](https://github.com/lukehoban/es6features#enhanced-o
bject-literals) | Approved
| |
237 | [Template strings](https://github.com/lukehoban/es6features#template-strings)
| Approved
| | 237 | [Template strings](https://github.com/lukehoban/es6features#template-strings)
| Approved
| |
238 | [Destructuring](https://github.com/lukehoban/es6features#destructuring)
| Approved
| | 238 | [Destructuring](https://github.com/lukehoban/es6features#destructuring)
| Approved
| |
239 | [Default, rest, and spread](https://github.com/lukehoban/es6features#default--
rest--spread) | To be discussed
| | 239 | [Default, rest, and spread](https://github.com/lukehoban/es6features#default--
rest--spread) | To be discussed
| |
240 | [`let` and `const`](https://github.com/lukehoban/es6features#let--const)
| `const` Approved
, `let` pending discussion | 240 | [`let` and `const`](https://github.com/lukehoban/es6features#let--const)
| Approved and req
uired for new code |
241 | [Iterators and `for...of`](https://github.com/lukehoban/es6features#iterators-
-forof) | Approved
| | 241 | [Iterators and `for...of`](https://github.com/lukehoban/es6features#iterators-
-forof) | Approved
| |
242 | [Generators](https://github.com/lukehoban/es6features#generators)
| Approved
| | 242 | [Generators](https://github.com/lukehoban/es6features#generators)
| Approved
| |
243 | [Unicode](https://github.com/lukehoban/es6features#unicode)
| To be discussed
| | 243 | [Unicode](https://github.com/lukehoban/es6features#unicode)
| To be discussed
| |
244 | [Modules](https://github.com/lukehoban/es6features#modules)
| To be discussed
| | 244 | [Modules](https://github.com/lukehoban/es6features#modules)
| To be discussed
| |
245 | [Module loaders](https://github.com/lukehoban/es6features#module-loaders)
| To be discussed
| | 245 | [Module loaders](https://github.com/lukehoban/es6features#module-loaders)
| To be discussed
| |
246 | [`Map`, `Set`, `WeakMap`, and `WeakSet`](https://github.com/lukehoban/es6featu
res#map--set--weakmap--weakset) | Approved
| | 246 | [`Map`, `Set`, `WeakMap`, and `WeakSet`](https://github.com/lukehoban/es6featu
res#map--set--weakmap--weakset) | Approved
| |
247 | [Proxies](https://github.com/lukehoban/es6features#proxies)
| To be discussed
| | 247 | [Proxies](https://github.com/lukehoban/es6features#proxies)
| To be discussed
| |
248 | [Symbols](https://github.com/lukehoban/es6features#symbols)
| To be discussed
| | 248 | [Symbols](https://github.com/lukehoban/es6features#symbols)
| To be discussed
| |
249 | [Subclassable Built-ins](https://github.com/lukehoban/es6features#subclassable
-built-ins) | Approved
| | 249 | [Subclassable Built-ins](https://github.com/lukehoban/es6features#subclassable
-built-ins) | Approved
| |
250 | [Promises](https://github.com/lukehoban/es6features#promises)
| Approved
| | 250 | [Promises](https://github.com/lukehoban/es6features#promises)
| Approved
| |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 1. Emit a clear warning and continue if the error is non-catastrophic | 288 1. Emit a clear warning and continue if the error is non-catastrophic |
289 2. Fail loudly if the error is catastrophic | 289 2. Fail loudly if the error is catastrophic |
290 | 290 |
291 If fixing the problem is hard but a simple workaround is possible, then using | 291 If fixing the problem is hard but a simple workaround is possible, then using |
292 the workaround is OK so long as: | 292 the workaround is OK so long as: |
293 | 293 |
294 1. An issue is created to track the problem. | 294 1. An issue is created to track the problem. |
295 2. The defensive patch is wrapped in a `// TODO` linking to that issue. | 295 2. The defensive patch is wrapped in a `// TODO` linking to that issue. |
296 3. The todo and defensive patch are removed after the problem is fixed. | 296 3. The todo and defensive patch are removed after the problem is fixed. |
OLD | NEW |