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

JSON.parse doesn't conform with ES2015 for Map object for iteration order #954

Open
nashtsai opened this issue Dec 14, 2016 · 2 comments
Open
Labels

Comments

@nashtsai
Copy link

Since ECMAScript 2015, using the Map object could be an alternative. A Map shares some similarities with an Object and guarantees the keys order:

A Map iterates its elements in insertion order, whereas iteration order is not specified for Objects.

Consider using LinkedHashMap instead of HashMap/TreeMap for internal default implementation.

@wenshao
Copy link
Member

wenshao commented Dec 19, 2016

JSON.parseObject("...", Feature.OrderedField)

@nashtsai
Copy link
Author

nashtsai commented Dec 22, 2016

got it, thanks, however, any plan to make ES2015 conform behavior?

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

No branches or pull requests

2 participants