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 export destructured assignment #5100

Open
helixbass opened this issue Aug 26, 2018 · 2 comments
Open

Support export destructured assignment #5100

helixbass opened this issue Aug 26, 2018 · 2 comments

Comments

@helixbass
Copy link
Collaborator

Choose one: is this a bug report or feature request?
Feature request

@GeoffreyBooth I came across an unsupported export syntax that appears to be standard

Input Code

export {foo, bar} = item

Expected Behavior

Should transpile to export var {foo, bar} = item

Current Behavior

Doesn't compile

Possible Solution

Guessing it won't be bad to add this as a supported grammar rule

Context

Not blocking anything, just came across it while working on AST stuff

Environment

  • CoffeeScript version:
  • Node.js version:
@GeoffreyBooth
Copy link
Collaborator

Good catch. I guess this can be the workaround for now:

{foo, bar} = item
export {foo, bar}

@edemaine
Copy link
Contributor

edemaine commented Apr 12, 2022

Another example of this:

export [signal, setSignal] = createSignal()

should ideally compile to

export const [signal, setSignal] = createSignal()

Same workaround works, of course:

[signal, setSignal] = createSignal()
export {signal, SetSignal}

I'll probably look into fixing this, after I finally get to revising #5398.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants