Destructuring objects
Open
Nobody has claimed this yet.
KIND: FEATURE REQUEST
Parser
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Records have some nice destructuring:
type foo = {bar: string, baz: int};
let z = {bar:"blah", baz:123};
let {bar, baz} = z;
let f = ({bar, baz}) => bar;
Would be nice to have the same for JS objects too:
type foo = {. "bar": string, "baz": int};
let z = {"bar":"blah", "baz":123};
let {bar, baz} = z;
let f = ({bar, baz}) => bar;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named in the issue. Start by locating the compiler areas that parse and type-check object destructuring, then compare their handling of records with JavaScript objects. Done means the shown JavaScript-object examples compile and behave as intended, with coverage for the new syntax.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, ocaml
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100