tc39/proposal-extractors

Array extractors can collide with assignments

Closed this issue · 1 comments

They are already valid JS:

// variable declaration + assignment
let Foo
(x) = y

// assignment + assignment
Foo
(x.z) = y

Here are some solutions for this issue:

  1. forbid the line terminator between QualifiedName[?Yield, ?Await] and ExtractorArrayBindingPattern[?Yield, ?Await]
  2. use other sigils for the array pattern, i.e. ||, ~[], etc.
  3. innovate the syntax, i.e. let [x] with Foo = y, etc.

Sorry for the noise. I actually turned on error recovery mode and overlook the errors.