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:James M Snell <jasnell@gmail.com> Reviewed-By:
Evan Lucas <evanlucas@me.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
parent
6df23fa3
Please register or sign in to comment