Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Nest default formats and properly merge specified formats #50

Merged
merged 1 commit into from
Feb 11, 2014

Conversation

ericf
Copy link
Collaborator

@ericf ericf commented Feb 11, 2014

This nests the default formats, and will properly merge the custom formats provided via the constructor.

formats = extend(objCreate(MessageFormat.FORMATS), formats);
// Creates a new object with the specified `formats` merged with the
// default formats.
formats = this._mergeFormats(MessageFormat.FORMATS, formats);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still think this is an expensive operation, closing the default formats, plus the custom one! so I will like to see hotwiring when possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's actually faster now than it was before because of the check I do to only merge if there's formats for a type on formats object passed in.

@caridy
Copy link
Collaborator

caridy commented Feb 11, 2014

+1

@ericf
Copy link
Collaborator Author

ericf commented Feb 11, 2014

@caridy This is actually slightly faster than it was before ;)

@apipkin
Copy link
Contributor

apipkin commented Feb 11, 2014

This looks good to me. I can't believe how clean this looks and how the formats will be called make so much sense.

Tests appear to be failing due to credentials on sauce.

+1

@ericf
Copy link
Collaborator Author

ericf commented Feb 11, 2014

The tests always fail because of sauce. @drewfish what do we have to do to make them pass in PRs and on master? Currently they fail in both places.

ericf added a commit that referenced this pull request Feb 11, 2014
Nest default formats and properly merge specified formats
@ericf ericf merged commit 7e79b3c into formatjs:master Feb 11, 2014
@ericf ericf deleted the nested-formats branch February 11, 2014 16:31
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.

None yet

3 participants