fix sparse array inspection (#16204)

fix https://github.com/denoland/deno/issues/16202
This commit is contained in:
sigmaSd 2022-10-10 15:22:21 +01:00 committed by GitHub
parent 1ab3691b09
commit 70ad6717df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View file

@ -770,6 +770,16 @@ Deno.test(function consoleTestStringifyIterable() {
`[ <1 empty item> ]`,
);
assertEquals(
stringify([, , 1]),
`[ <2 empty items>, 1 ]`,
);
assertEquals(
stringify([1, , , 1]),
`[ 1, <2 empty items>, 1 ]`,
);
const withEmptyElAndMoreItems = Array(500);
withEmptyElAndMoreItems.fill(0, 50, 80);
withEmptyElAndMoreItems.fill(2, 100, 120);