Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Use Ember.assign() if possible #93

Closed
wants to merge 1 commit into from
Closed

Use Ember.assign() if possible #93

wants to merge 1 commit into from

Conversation

Cryrivers
Copy link
Contributor

As Ember.merge is deprecated since Ember 2.5.0

@@ -200,8 +200,8 @@ export default class AjaxRequest {
*/
_getFullHeadersHash(headers) {
const classHeaders = get(this, 'headers') || {};
const _headers = merge({}, classHeaders);
return merge(_headers, headers);
const _headers = assign({}, classHeaders);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assign allows more than two arguments so we should be able to do this in a single invocation:

return assign({}, classHeaders, headers);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, but we can't do that until we can require v2.5.0, 😿

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue yep, assign could be Ember.merge. :trollface:

@rwjblue
Copy link
Member

rwjblue commented Apr 12, 2016

This LGTM

@alexlafroscia
Copy link
Collaborator

Hmm, @Cryrivers CI doesn't seem very happy with the change, but it looks good to me once that is settled.

@Cryrivers
Copy link
Contributor Author

@alexlafroscia not sure why those 5 test cases failed 😢

@orf
Copy link

orf commented Apr 22, 2016

Looks like the deprecation has been removed: emberjs/ember.js#13344

@alexlafroscia
Copy link
Collaborator

Yeah, in light of that fact, I'm going to close this. Thanks for the PR though, @Cryrivers!

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

Successfully merging this pull request may close these issues.

4 participants