restore the non-standard displayName feature
Categories
(DevTools :: Debugger, enhancement)
Tracking
(Not tracked)
People
(Reporter: jaborandi, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0
Steps to reproduce:
the non-standard displayName feature is the only effective way to get a usable stack trace for object-oriented code
the only one that works universally - regardless of how the specific framework implements classes, and - right now - the only one that would work at all, since even for native classess methods stack trace shows no class names (bug #1748135), regardless of whether you use ES6 syntax or prototypes
However this feature seems to have been removed
I don't know in which version, but, although MDN lists it as supported by FF, at least in versions 82 and 95 the following code
var a = function() { console.trace(); }; a.displayName = 'b'; a();
yelds
console.trace() ...
a ...
<anonymous> ...
not
console.trace() ...
b ...
<anonymous> ...
stack trace of an OOP code without class names is not unlike a street address without city and country for international shipping - it is half-useless
and even when #1748135 is revolsed it'd be an unreasonable to expect everyone to abandone frameworks and migrate to using native classes / constructs only
please restore the displayName support
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Hello!
Thank you for reporting this issue, I will mark this issue as NEW and setting a component for this issue in order for our developers to look more into it and take into consideration on further releases! If it's not the right component please feel free to change it to an appropriate one.
Best regards,
Sergiu
| Reporter | ||
Comment 2•4 years ago
|
||
there's a Function object's name property
which is read-only, but configurable
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
In Chrome, this property's value is used in all stack traces.
In Firefox, however, it
So, I figure it's more appropriate to create a bug, requesting to use name property in stack trace, instead of restoring non-standard property.
Changing this one to Resolved
| Reporter | ||
Comment 3•4 years ago
|
||
*In FF, however, it is not
| Reporter | ||
Updated•4 years ago
|
Comment 4•4 years ago
|
||
(In reply to support from comment #2)
So, I figure it's more appropriate to create a bug, requesting to use name property in stack trace, instead of restoring non-standard property.
Changing this one to Resolved
Is the new bug filed somewhere?
Honza
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Comment 6•4 years ago
|
||
@Jan Honza Odvarko - yes, sorry, just added that
Description
•