Open matanlurey opened 7 years ago
Technical, it's not test
, but an anonymous closure in test
. I think we end up naming these dart.fn
.
Should be easy to name / stack-map to something else.
@vsmenon Is this still an issue?
anonymous functions are still auto-detected by Chrome as dart.fn
It's because we must tag their types:
// compiled JS:
test.test(..., dart.fn(() => { ... }));
We can't avoid tagging the type.
We could have a longer name for dart.fn
like dart.anonymous
. We could give the function a name like anonymous
. We could see that the anonymous function is an argument to the Dart function named test
, and use that name ... we won't have names like that in general, but we could find them in this example. I don't know if that's actually more helpful, though?
All of these will increase code size.
In our new debugger prototype, we can detect and render anonymous Dart functions differently in the web inspector. So that's an idea.
I'm not sure what (if anything) to do here.
@alan-knight this may be fixable now in the new Debugger UI?
We wouldn't be able to do anything about printed stack traces there, but we could tweak the stack frame display in the debugger. It's not obvious to me why the function is getting the dynamically containing function name prepended to it. I'd expect to see something with the statically containing scope. But I think it's basically happening here https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/sources/CallStackSidebarPane.js?rcl=3df5254f608bfec7ee6407faed8c7232b935f318&l=256
but it might be some work to get the information we'd need to name it appropriately. We can get the containing file and line number, but more than that I don't know.
Thanks to hard work by many, the DDC stack traces in the latest SDK look good 🤞
There are still some minor things, though, for example around closures:
Emits:
I never wrote
test$.test.dart.fn
. It would be nice for this to say: