[FIX] devtools: arrays are objects

This commit fixes some dead code related to the display of arrays inside
other objects. Arrays are objects indeed so the condition was impossible
to satisfy.
This commit is contained in:
Julien Carion (juca)
2024-10-24 10:47:56 +02:00
committed by Géry Debongnie
parent c2daecc07b
commit 5ecb4809ff
@@ -58,15 +58,16 @@
// The asConstructorName parameter can be passed to change the display of objects and functions to
// be their constructor name (useful for prototype, map and set display)
serializeItem(value, asConstructorName = false) {
if (typeof value === "array") {
return "Array(" + value.length + ")";
} else if (typeof value === "object") {
if (typeof value === "object") {
if (value == null) {
return "null";
}
if (asConstructorName) {
return value.constructor.name;
}
if (value instanceof Array) {
return "Array(" + value.length + ")";
}
return "{...}";
} else if (typeof value === "undefined") {
return "undefined";