jashkenas / jashkenas/coffeescript

Support export destructured assignment

Open
#5,100 2 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
CoffeeScript
Stars
16.6k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

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

```coffee
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:

Contributor guide

Open the contributing guide

Research direction

Reproduce the CoffeeScript input `export {foo, bar} = item` with the compiler and compare it with the expected `export var {foo, bar} = item` output. Start by tracing the grammar and AST handling for export and destructured assignment; done means the syntax compiles to the expected JavaScript without regressing related cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, javascript
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.