Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Rest parameters in async function #5330

Closed
laggingreflex opened this issue Feb 16, 2017 · 3 comments
Closed

[bug] Rest parameters in async function #5330

laggingreflex opened this issue Feb 16, 2017 · 3 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@laggingreflex
Copy link

Input Code

const a = async(...args) => console.log(args);
const b = async(...args) => a(...args);

b('1');

Babel Configuration (.babelrc, package.json, cli command)

"presets": [
    "es2015",
    "stage-0"
  ]

Expected Behavior

It should output [ '1' ]. Works with node 7 --harmony. Also works without async functions. Problem is only with async functions

Current Behavior

It outputs something big I'm not sure what (global object?)

Module {
    id: 'C:\\...\\test\\utils\\memoize.js',
    exports: {},
    parent:
     Module {
       id: 'C:\\...\\test\\utils\\index.js',
       exports: [Object],
       parent: [Object],
       filename: 'C:\\...\\test\\utils\\index.js',
       loaded: false,
       children: [Object],
       paths: [Object] },
    filename: 'C:\\...\\test\\utils\\memoize.js',
    loaded: false,
    children: [ [Object] ],
    paths:
     [ 'C:\\...\\test\\utils\\node_modules',
       'C:\\...\\test\\node_modules',
       'C:\\...\\node_modules',
       'C:\\...',
       'C:\\...node_modules',
       'C:\\...

Possible Solution

Context

Your Environment

software version
Babel
node 7
npm 3
Operating System win10
"babel-cli": "^6.22.2",
"babel-polyfill": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
@babel-bot
Copy link
Collaborator

Hey @laggingreflex! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@laggingreflex laggingreflex changed the title [bug] Spread args in async function [bug] Rest parameters in async function Feb 16, 2017
@laggingreflex
Copy link
Author

related (dupe?) #4219

@hzoo
Copy link
Member

hzoo commented Mar 15, 2017

Yeah I believe so 👍 , #4219

@hzoo hzoo closed this as completed Mar 15, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

3 participants