Skip to content

Why does object splatting generate an unneeded function? #4733

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

Closed
boris-petrov opened this issue Oct 3, 2017 · 1 comment
Closed

Why does object splatting generate an unneeded function? #4733

boris-petrov opened this issue Oct 3, 2017 · 1 comment
Labels

Comments

@boris-petrov
Copy link

From here:

var currentUser, user,
  _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

CoffeeScript 2 generates ES2015 code and as I understand Object.assign is standardized in ES2015. So why the unnecessary function?

@lydell
Copy link
Collaborator

lydell commented Oct 3, 2017

@boris-petrov See #4674.

@lydell lydell closed this as completed Oct 3, 2017
@lydell lydell added the question label Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants