Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

装饰器的提案已经更新 #661

Closed
islishude opened this issue May 4, 2018 · 5 comments
Closed

装饰器的提案已经更新 #661

islishude opened this issue May 4, 2018 · 5 comments

Comments

@islishude
Copy link
Contributor

islishude commented May 4, 2018

看了最新的装饰器提案,阮老师的书上的应该是旧提案

变化有些大真得很大,我觉得有必要加一段说明书上写的是旧提案。

@ruanyf
Copy link
Owner

ruanyf commented May 9, 2018

我粗粗看了一下,变化没有想象的那么大。

后面找时间仔细看具体的差异,再修改掉具体的内容。

@ruanyf ruanyf closed this as completed May 9, 2018
@ruanyf
Copy link
Owner

ruanyf commented May 9, 2018

具体差异应该是这一段 https://github.com/tc39/proposal-decorators/blob/master/DETAILS.md#changes-from-the-previous-decorators-proposal

有些地方没看明白,还待消化。

@islishude
Copy link
Contributor Author

装饰器提案再7月底的tc39会议差不多就到stage3了。

最新的提案也接收一个对象,但这个对象不仅仅有属性描述符,还有kind类型用于判断是类还是类属性或者类方法。返回值还有init函数,extras 对象(可用于注解),finisher 函数用于类声明完成后要做的工作。

内容太多,感觉几乎需要重写这一章,所以不太好PR。如果阮老师出一个这本书规范出来,我有空可以帮忙。(只是修改一些部分然后PR还有自信做 orz)

https://github.com/tc39/proposal-decorators/blob/master/METAPROGRAMMING.md

@ruanyf
Copy link
Owner

ruanyf commented Jul 17, 2018

这一章肯定重写。

目前再消化一下,也等等看,有没有示例出来,要是有实现支持就更好了。

@islishude
Copy link
Contributor Author

还在进行中
babel/proposals#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants