Skip to content

Conversation

@eemeli
Copy link
Contributor

@eemeli eemeli commented Apr 18, 2020

Currently, when called with { references: true }, objects containing a repeated or circular reference will not have the property in question set until after the initialiser is done. This means that the key order may change from the original.

Now admittedly, the key order is not guaranteed by ECMAScript in the first place, but the fix that's required is really rather minimal; just put in an undefined value during the initialiser and replace that in the subsequent assignment. This would also make objects more closely match the current behaviour of arrays.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.755% when pulling d8c8305 on eemeli:maintain-order into 3155073 on blakeembrey:master.

@blakeembrey blakeembrey merged commit 1d32d25 into blakeembrey:master Apr 18, 2020
@blakeembrey
Copy link
Owner

Thanks @eemeli!

@eemeli eemeli deleted the maintain-order branch April 8, 2022 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants