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

Json.Decode.keyValuePairs need not reverse order #849

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@zwilias
Member

zwilias commented Apr 1, 2017

Reversing the entries does not break any guarantees: an object is an unordered collection of key-value pairs as per the spec.

However, browsers generally respect order of definition when dealing with objects, and reverting that order when converting to an ordered data-structure violates the principle of least surprise.

Json.Decode.keyValuePairs need not reverse order
Reversing the entries does not break any guarantees: an object is an unordered collection of key-value pairs as per the spec. 

However, browsers generally respect order of definition when dealing with objects, and reverting that order when converting to an ordered data-structure violates the principle of least surprise.
@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Apr 1, 2017

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Apr 1, 2017

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

evancz added a commit that referenced this pull request Jul 8, 2017

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jul 8, 2017

Member

I was going through this library the other day and wasn't sure if I should put things in order. Based on seeing this PR and #863, I figured I'd go for it.

Member

evancz commented Jul 8, 2017

I was going through this library the other day and wasn't sure if I should put things in order. Based on seeing this PR and #863, I figured I'd go for it.

@evancz evancz closed this Jul 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment