You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 19, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: Features.md
+6-35Lines changed: 6 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ These features affect interopability and should take priority over all other fea
12
12
13
13
>CoffeeScript 1.x and 2
14
14
15
-
[This has been merged](https://github.com/jashkenas/coffeescript/pull/4300)into the original CoffeeScript compiler. It will ship with the next release.
15
+
[This has been merged](https://github.com/jashkenas/coffeescript/pull/4300)and released as part of CoffeeScript 1.11.
As part of CoffeeScript 2, we will revise CoffeeScript’s`class` syntax to be compatible with ECMAScript’s`class`; this means no code in class bodies, no using`this` in a constructor before calling`super`, etc. Wewill inherit the limitationsofECMAScript’s`class`, butthebenefit of being able toextendthemandgeneratenativeES2015classes. Getters and setters[(#17)](https://github.com/coffeescript6/discuss/issues/17) wouldneed tobe implemented as part of supporting ES classes.
21
+
As part of CoffeeScript 2, we will revise CoffeeScript’s`class` syntax to be compatible with ECMAScript’s`class`; this means no code in class bodies, no using`this` in a constructor before calling`super`, etc. Wetry to keep as many featuresofthe CoffeeScript`class` as possible while still ouputtingtheECMAScript`class` keyword, so that we canextendES classesandcreate extendablenative classes. Getters and setters[(#17)](https://github.com/coffeescript6/discuss/issues/17) wouldprobablybe implemented as part of supporting ES classes. This is in progress at[jashkenas/coffeescript#4330](https://github.com/jashkenas/coffeescript/pull/4330).
>An[old pull request](https://github.com/jashkenas/coffeescript/pull/3757) basically implements this feature exactly as we’ve outlined it below, though the PR contains an ES5 shim which should be removed.
38
-
39
-
`async`/`await` isn’t completely standardized yet; it’s not part of ES2015 or ES2016, though it is supported in Edge and in Chrome behind a flag.[It has reached Stage 4 of ES2017](https://github.com/tc39/proposals/blob/master/finished-proposals.md).
40
-
41
-
CoffeeScript’s version would add only the`await` keyword, which would automatically cause CoffeeScript to output an`async` keyword where needed. This behavior is similar to how generators are handled, where the presence of a`yield` keyword causes CoffeeScript to declare the function as`function*`: the presence of`await` would cause CoffeeScript to declare its associated function with`async`.
42
-
43
-
So to take the example fromhttp://stackabuse.com/node-js-async-await-in-es7/, this #"diff-4588afae1af31173f8a25f1c5a55d5f22ab16802f5dd595171cb0156ec33b4c7-44-34-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">44
-
45
-
```js
46
-
var request=require('request-promise');
35
+
>CoffeeScript 2
47
36
48
-
asyncfunctionmain() {
49
-
var body=awaitrequest.get('https://api.github.com/repos/scottwrobinson/camo');