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

es8 async/await bug #30

Open
yanhaijing opened this issue Sep 19, 2018 · 6 comments
Open

es8 async/await bug #30

yanhaijing opened this issue Sep 19, 2018 · 6 comments

Comments

@yanhaijing
Copy link

es5 code is work

image

es6 code don't work

image

@Bogdan-Lyashenko
Copy link
Owner

Bogdan-Lyashenko commented Sep 19, 2018

@yanhaijing hey. Thanks for feedback. Not sure what is logic behind that code, but valid code will be

var a = 12;
if (a) {
  const a = 1;
} else {
  const a = 2;
}

so const is block scoped but var not. And that code works fine.

@yanhaijing
Copy link
Author

yanhaijing commented Sep 19, 2018

thank you advice,
but I want use the tool to process my work code, my work code is written by es6, o(╥﹏╥)o

@Bogdan-Lyashenko
Copy link
Owner

@yanhaijing that's fine, it does support es6. You can check examples https://github.com/Bogdan-Lyashenko/js-code-to-svg-flowchart/tree/master/docs/examples (code-sample.js), each of them written in es6.

@yanhaijing
Copy link
Author

yanhaijing commented Sep 19, 2018

https://bogdan-lyashenko.github.io/js-code-to-svg-flowchart/docs/live-editor/index.html

↑this url enter code ↓, async don't support

async function () {
	
}

@Bogdan-Lyashenko
Copy link
Owner

ah, I see, yes, it's not supported, sorry for that. async-await are es7 features, not es6 😛 I need to update babylon AST parser to support that.

@yanhaijing yanhaijing changed the title es6 bug es8 bug Sep 19, 2018
@yanhaijing yanhaijing changed the title es8 bug es8 async/await bug Sep 19, 2018
@yanhaijing
Copy link
Author

Thank you for your work. Come on

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