DevTools: functions in object preview should get better names |
|
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
,
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 |
|
Comment 1 by l...@chromium.org
, Apr 26 2018Another 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.