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

Remove unused calls to pure functions #647

Closed
j-f1 opened this issue Aug 8, 2017 · 4 comments
Closed

Remove unused calls to pure functions #647

j-f1 opened this issue Aug 8, 2017 · 4 comments

Comments

@j-f1
Copy link
Contributor

j-f1 commented Aug 8, 2017

Babili could use an @pure JSDoc tag to determine which functions are pure, then remove unused calls to them.

AST Explorer with code + example: https://astexplorer.net/#/gist/bdcbc34df3916d324454a332988503c7/7c39cede7af9cc9244f89876bb8339a5a4fb3d37

In:

/** @pure */
const myPureFunc = () => {}
myPureFunc()

Out:

/** @pure */
const myPureFunc = () => {}
@nicolo-ribaudo
Copy link
Member

Instead of @pure Babili could use #__PURE__, like Uglify: mishoo/UglifyJS#1448, babel/babel#5632

@hzoo
Copy link
Member

hzoo commented Aug 8, 2017

This is a similar request to babel/babel#5632? Referencing the same issue too. I'm already in favor of doing it

@j-f1
Copy link
Contributor Author

j-f1 commented Aug 8, 2017

Sort of — this one will strip out calls to pure functions, while that one wants to add an annotation to functions wrapping transpiled classes.

@boopathi
Copy link
Member

boopathi commented Aug 8, 2017

Duplicate #520

@boopathi boopathi closed this as completed Aug 8, 2017
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

4 participants