mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[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:
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
|
// 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)
|
// be their constructor name (useful for prototype, map and set display)
|
||||||
serializeItem(value, asConstructorName = false) {
|
serializeItem(value, asConstructorName = false) {
|
||||||
if (typeof value === "array") {
|
if (typeof value === "object") {
|
||||||
return "Array(" + value.length + ")";
|
|
||||||
} else if (typeof value === "object") {
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return "null";
|
return "null";
|
||||||
}
|
}
|
||||||
if (asConstructorName) {
|
if (asConstructorName) {
|
||||||
return value.constructor.name;
|
return value.constructor.name;
|
||||||
}
|
}
|
||||||
|
if (value instanceof Array) {
|
||||||
|
return "Array(" + value.length + ")";
|
||||||
|
}
|
||||||
return "{...}";
|
return "{...}";
|
||||||
} else if (typeof value === "undefined") {
|
} else if (typeof value === "undefined") {
|
||||||
return "undefined";
|
return "undefined";
|
||||||
|
|||||||
Reference in New Issue
Block a user