New issue
Advanced search Search tips

Issue 813210 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: functions in object preview should get better names

Project Member Reported by l...@chromium.org, Feb 16 2018

Issue description

What steps will reproduce the problem?
(1) Evaluate this in DevTools' console:
`
var abc = function (){};
var bound_abc = abc.bind(this);
[abc, bound_abc];
`

(2) Expand the array to see the function properties

What is the expected result?
We can get better names 'abc' and 'bound bound_abc'.  Expanding the functions shows the 'name' property on these.

What happens instead?
Function property values are just formatted as `f ()` with no name
 

Comment 1 by l...@chromium.org, Apr 26 2018

Another surprising case:
class a {function () {} function2() {}};
var b = new a;
b.function2

Prints:
ƒ 2() {}

This should be fix-able in injected-script-source.  We can get the .name on function objects when producing their description.

Comment 2 by l...@chromium.org, May 18 2018

Strangely, `console.dir(bound_abc)` prints with `f bound abc(){}` while `console.log(bound_abc)` does not

Sign in to add a comment