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

wrong transformation attempt of sequence expressions with target es5 #1211

Closed
edoardocavazza opened this issue Apr 27, 2021 · 1 comment
Closed

Comments

@edoardocavazza
Copy link

With the following code and targeting es5

export function foo(check) {
    var hover = 1;
    return check ? (hover = 2, bar()) : baz();
}

esbuild exits with this error:

error: Transforming default arguments to the configured target environment ("es5") is not supported yet
    2 │     return check ? (this.hover = false, this.a()) : this.b();
      ╵                                ^
@evanw
Copy link
Owner

evanw commented Apr 27, 2021

Thanks for the report. It looks like this is due to speculative parsing parentheses as an arrow function, and only happens in TypeScript code. I'll get this fixed in the next release.

@evanw evanw closed this as completed in 695b40d Apr 27, 2021
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