Fix missing function names in console.log and Bun.inspect
Merged
JA
3y ago+94+94+01234567890123456789-21-21-01234567890123456789
What does this PR do?
Uses JSC::getCalculatedDisplayName for getting function names instead of
❯ bun /tmp/a.js
[Function]
❯ bun-debug /tmp/a.js
[Function: f]
❯ cat /tmp/a.js
│ File: /tmp/a.js
1 │ var f = (x) => x;
2 │ f.length;
3 │ console.log(f);
Note that we do need to address a transpiler issue where inlining causes names of functions to be lost. This impacts const and let. We should assign these to their declared names instead. This is not possible to do for arrow functions, but is possible to do for regular functions.
How did you verify your code works?
Tests