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

Support logical assignment operator #715

Closed
schickling opened this issue Jan 27, 2021 · 4 comments
Closed

Support logical assignment operator #715

schickling opened this issue Jan 27, 2021 · 4 comments

Comments

@schickling
Copy link

It seems like logical assignment operators (TC39 stage 4) are currently not yet supported. As they are supported in TypeScript since version 4 (see PR), this means esbuild can't compile applications using this feature resulting in errors like this:

image

Would be great if support could be added for this feature :)

@evanw
Copy link
Owner

evanw commented Jan 27, 2021

I'm confused since support for this was added to esbuild a long time ago:

> echo "a ??= b" | esbuild
a ??= b;

> echo "a ??= b" | esbuild --target=es6
a != null ? a : a = b;

Your screenshot looks like an error from the TypeScript compiler, not from esbuild. Maybe you have an old version of the TypeScript compiler installed?

@schickling
Copy link
Author

Funnily enough I'm currently toying with a Figma plugin and have been using figplug by @rsms which uses TS 3.9.6. Upgrading did the tricky indeed. Thanks!

@rsms
Copy link

rsms commented Jan 27, 2021

Thanks for the ping @schickling — I've published a new version of figplug with typescript 3.9.7 (and fresh Figma API type definitions)

@schickling
Copy link
Author

FWIW @rsms In this particular case you'd probably need to upgrade TS to 4.0+ otherwise the new logical assignment operators won't yet be supported (to my knowledge).

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

3 participants