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

Constant folding inlines array instead of concatenating it #580

Closed
merih opened this issue Jun 15, 2017 · 2 comments
Closed

Constant folding inlines array instead of concatenating it #580

merih opened this issue Jun 15, 2017 · 2 comments

Comments

@merih
Copy link

merih commented Jun 15, 2017

babel-plugin-minify-constant-folding plugin converts

function (x) {
    return [].concat(x);
}

into

function (x) {
    return [x];
}

which poses a problem when x is an array.

Probably introduced in #505

@edc
Copy link

edc commented Jun 15, 2017

Same here. This breaks react-router and possibly other React packages because of how class is transpiled with babel: _this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))). That concat always fails with this bug, because it is converted to [this, args].

@boopathi
Copy link
Member

Fixed in #578

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

No branches or pull requests

3 participants