facebook/regenerator

Crashes when processing sparse array with `await`

SuperSodaSea opened this issue · 0 comments

The following code will crash regenerator:

async () => [, await 0];

It will throw error (using https://facebook.github.io/regenerator/):

TypeError: unknown: Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got undefined
    at Object.validate (bundle.js:72816:11)
    at validateField (bundle.js:79750:9)
    at validate (bundle.js:79743:3)
    at validateNode (bundle.js:68534:27)
    at Object.assignmentExpression (bundle.js:64971:36)
    at Ep.assign (bundle.js:120582:34)
    at Ep.emitAssign (bundle.js:120575:18)
    at Ep.explodeViaTempVar (bundle.js:121138:19)
    at bundle.js:121250:23
    at Array.map (<anonymous>)

I'd like to make a PR to fix this problem later.

See also: babel/babel#15142