Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 19, 2018. It is now read-only.
/discussPublic archive

Commit798b04f

Browse files
Current status as of 2016-11-03
1 parent7bc8953 commit798b04f

File tree

1 file changed

+6
-35
lines changed

1 file changed

+6
-35
lines changed

‎Features.md

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ These features affect interopability and should take priority over all other fea
1212

1313
>CoffeeScript 1.x and 2
1414
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.
1616

1717
###Classes[(#22)](https://github.com/coffeescript6/discuss/issues/22)
1818

1919
>CoffeeScript 2 only
2020
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. 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).
2222

2323
###Tagged template literals[(#28)](https://github.com/coffeescript6/discuss/issues/28)
2424

@@ -32,37 +32,9 @@ These features aren’t required for CoffeeScript to be used in any project, but
3232

3333
###`async`/`await`[(#10)](https://github.com/coffeescript6/discuss/issues/10)
3434

35-
>CoffeeScript 1.x and 2
36-
37-
>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
4736
48-
asyncfunctionmain() {
49-
var body=awaitrequest.get('https://api.github.com/repos/scottwrobinson/camo');
50-
console.log('Body:', body);
51-
}
52-
main();
53-
```
54-
55-
could be written in CoffeeScript as:
56-
57-
```coffee
58-
request=require'request-promise'
59-
60-
main=->
61-
body=awaitrequest.get'https://api.github.com/repos/scottwrobinson/camo'
62-
console.log'Body:', body
63-
64-
main()
65-
```
37+
[This has been merged](https://github.com/jashkenas/coffeescript/pull/3757) into the`2` branch.
6638

6739
###Backticked blocks[(#42)](https://github.com/coffeescript6/discuss/issues/42)
6840

@@ -84,7 +56,7 @@ Output CoffeeScript’s interpolated strings—`"hello, #{name}!"`—as ES2015 t
8456

8557
>CoffeeScript 2 only
8658
87-
Fat arrows should be transpiledintoES2015`=>`. They took our good idea, let’s celebrate by using it.
59+
[This has been merged](https://github.com/jashkenas/coffeescript/pull/4311)intothe`2` branch.
8860

8961
###Destructuring assignment[(#18)](https://github.com/coffeescript6/discuss/issues/18)
9062

@@ -94,7 +66,7 @@ Fat arrows should be transpiled into ES2015 `=>`. They took our good idea, let
9466

9567
>CoffeeScript 2 only
9668
97-
There should be some way to output ESNext`for … of`, perhaps via a new`for` syntax. Awaiting consensus.
69+
[This is almost complete.](https://github.com/jashkenas/coffeescript/pull/4306)
9870

9971
##Uncertain
10072

@@ -123,4 +95,3 @@ These are other features that have been discussed, but the consensus at the mome
12395
###Decorators[(#9)](https://github.com/coffeescript6/discuss/issues/9)
12496

12597
###Type annotations[(#12)](https://github.com/coffeescript6/discuss/issues/12)
126-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp