Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Async functions with parameter destructuring don't work on Node 4.x #106

Closed
djanowski opened this issue Dec 20, 2016 · 2 comments
Closed

Comments

@djanowski
Copy link

  var _ref = _asyncToGenerator(function* ({ bar }) {});
                                          ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at loader (/private/tmp/foo/node_modules/babel-cli/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/private/tmp/foo/node_modules/babel-cli/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at /private/tmp/foo/node_modules/babel-cli/lib/_babel-node.js:159:24
    at Object.<anonymous> (/private/tmp/foo/node_modules/babel-cli/lib/_babel-node.js:160:7)
    at Module._compile (module.js:409:26)

Self-contained test: https://github.com/djanowski/babel-preset-env-async-destructuring

@existentialism
Copy link
Member

@djanowski bandaid fix, change the .babelrc value to 4.7 instead of "4.7.0"... it currently assumes numbers, should have a fix up shortly as well.

@djanowski
Copy link
Author

@existentialism 😂 Thanks a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants