Esm: Crash parsing object spread property as argument to arrow function.

Created on 30 Nov 2017  Â·  3Comments  Â·  Source: standard-things/esm

In @std/esm 0.17.3, given test.js:

export default ({...foo}) => {};

Running node -r @std/esm test produces the following stack:

TypeError: Cannot read property 'start' of undefined
    at bt.module.exports._t.toAssignable (…/node_modules/@std/esm/index.js:1:94584)
    at bt.module.exports._t.toAssignableList (…/node_modules/@std/esm/index.js:1:95534)
    at bt.module.exports.wt.parseArrowExpression (…/node_modules/@std/esm/index.js:1:90889)
    at bt.module.exports.wt.parseParenArrowList (…/node_modules/@std/esm/index.js:1:85672)
    at bt.module.exports.wt.parseParenAndDistinguishExpression (…/node_modules/@std/esm/index.js:1:85110)
    at bt.module.exports.wt.parseExprAtom (…/node_modules/@std/esm/index.js:1:83291)
    at bt.x (…/node_modules/@std/esm/index.js:1:54977)
    at bt.parseExprAtom (…/node_modules/@std/esm/index.js:1:19312)
    at bt.module.exports.wt.parseExprSubscripts (…/node_modules/@std/esm/index.js:1:80378)
    at bt.module.exports.wt.parseMaybeUnary (…/node_modules/@std/esm/index.js:1:79945)
bug

Most helpful comment

v0.18.0 is released 🎉

All 3 comments

Thanks @mbostock!

I'm just about to wrap up v0.18.0 so will include the fix in that.

Update:

Thanks for the failing test, I cherry-picked it in locally. I've located the problem. This bug is a regression that happened when I attempted to simplify the acorn plugin. So I just need to back in a bit more code to resolve it.

Update Update:

Patched locally.

v0.18.0 is released 🎉

Hooray! Thanks for the quick fix.

Was this page helpful?
0 / 5 - 0 ratings