Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Replace for-in with basic for loop in FormatNumber #177

Merged
merged 1 commit into from May 14, 2016

Conversation

watilde
Copy link
Contributor

@watilde watilde commented May 14, 2016

Fixes: #176.

Basically for-in loop iterate over all enumerable properties of the object itself and those the object inherits from its constructor's prototype. In the FormatNumber function, the parts Object is from List and that can be parent Object. To fix it, I think we should add a hasOwnProperty check into for-in loop or use this simple way.

@caridy
Copy link
Collaborator

caridy commented May 14, 2016

I wonder how is that this wasn't catch by our tests. I will merge and release the patch soon.

@caridy caridy merged commit 41ada9e into andyearnshaw:master May 14, 2016
@watilde watilde deleted the patch/fix-FormatNumber branch May 15, 2016 10:16
@caridy
Copy link
Collaborator

caridy commented May 16, 2016

there were few more places where the same problem occur, here is the patch: 6057ef3

@watilde
Copy link
Contributor Author

watilde commented May 16, 2016

Oh good catch. Thanks!

@caridy
Copy link
Collaborator

caridy commented May 17, 2016

released as intl@1.2.2

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.

NumberFormat returns duplicated string.
2 participants