-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implementation questions #5
Comments
It means you can have |
I'd like to transpile do expression down to ES2020 in this way, is it likely to have a bug in it?
|
There's a couple corner cases where there isn't really a single "result expression" - for example, |
For the For async transformation, I have no idea but I guess it is acceptable to have extra microtasks. |
It may be simpler to just put an A further corner case: expressions in a |
That's a bug. The second one should match the first. Fixed in 994a5cc. |
means label: while (true) x = do { break label } Is it an early error? |
Yup. See the readme. |
Oh, I found my transpile cannot handle this case. I think it's better to ban it as a bad practice in the type level (or make it not hoist in the spec). function x() {
const y = do {
var z = 1;
z;
}
z; // should be 1
} |
Ah, yeah, you would also have to hoist |
thanks for your answer, most of the work are done in microsoft/TypeScript#42437. there is also an online playground for it in the link |
I don't really understand what
[?Yield, ?Await, ~Return]
means. So, can I haveyield
orawait
in do expression? Can I have a return statement?The text was updated successfully, but these errors were encountered: