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

[CS2] use _extends utility instead of Object.assign() for object spreads #4675

Merged
merged 4 commits into from
Sep 1, 2017

Conversation

helixbass
Copy link
Collaborator

See #4674

This replaces the direct calls to Object.assign() currently generated by object spreads with a call to a new utility function _extends (directly copied from Babel's equivalent, defaults to using Object.assign when it's supported)

Added eqJS() test that _extends is being generated and used when compiling object spread

@helixbass helixbass mentioned this pull request Aug 31, 2017
@GeoffreyBooth
Copy link
Collaborator

We should have a test that covers if a user creates a function named _extends in the same scope as object destructuring.

@GeoffreyBooth
Copy link
Collaborator

@helixbass I’ve added the test. Anyone else have any notes? @lydell or @connec?

@GeoffreyBooth GeoffreyBooth merged commit b20e52d into jashkenas:2 Sep 1, 2017
@helixbass
Copy link
Collaborator Author

@GeoffreyBooth thanks for adding the addtl test and docs

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

Successfully merging this pull request may close these issues.

2 participants