Unverified Commit ec2f0981 authored by Alexey Orlenko's avatar Alexey Orlenko Committed by Anna Henningsen
Browse files

util: change sparse arrays inspection format

Missing elements in sparse arrays used to be serialized to empty
placeholders delimited with commas by util.inspect() and in some cases
the result was a syntactically correct representation of a JavaScript
array with shorter length than the original one. This commit implements
@TimothyGu's suggestion to change the way util.inspect() formats sparse
arrays to something similar to how Firefox shows them.

Fixes: https://github.com/nodejs/node/issues/11570
PR-URL: https://github.com/nodejs/node/pull/11576


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarEvan Lucas <evanlucas@me.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarTimothy Gu <timothygu99@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent 6df23fa3
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment