lezer-parser/javascript

Computed property names in object destructuring

Closed this issue · 2 comments

The current grammar doesn't support computed property names in object destructuring, for example

const {[Symbol.iterator]: iterator} = array;

is valid JavaScript (and TypeScript), but CodeMirror gets highly confused about what it's looking at.

cc @jaro-sevcik

I didn't even know that was a thing! Attached patch adds support.

Wow, thanks!