Show <prototype> even if it's null
Loirooriol opened this issue · comments
If I have an object whose [[Prototype]] is null
the object inspector does not show <prototype>
. This case can be confused with objects whose prototype chain is not known, e.g. proxies. So I would make it explicit and not hide the <prototype>
even if it's null. Also consider this case:
var obj = Object.create(null);
obj.__proto__ = Object.prototype;
inspect(obj);
Someone might be confused by the __proto__
property and think that the object inherits from Object.prototype
.
▼ {...}
| ▶ __proto__: Object { … }
I think this would be clearer:
▼ {...}
| ▶ __proto__: Object { … }
| <prototype>: null
I believe changing this conditional would do the trick:
Yes, this could be interesting, thanks for filing
This issue was moved to firefox-devtools/debugger#6110