sdk
sdk copied to clipboard
[Wildcard Variables] Web debugging support
This issue tracks the web debugging support needed for the wildcards feature.
References
Correct - I think the nuance here is that in the code we emit in JavaScript we need to introduce a placeholder name to generate a valid function signature.
While our intent was to eventually make dwds model all of its state based on what we know from the dart program, there were cases in the past where it created its internal model based on the Chrome debugger's state of the application. If that is still the case today, we may need to do some work to ensure those synthetic variables are properly ignored/hidden.
Originally posted by @sigmundch in #55751
cc. @nshahan @bkonyi
One potential work item that came up from the discussion between the VM and CFE team this afternoon
- wildcard locals would have to be filtered out when sending information about local variables to the client as part of the vm service reply
It is possible something similar would be needed on the web side too.
@kallentu It will be helpful if the CFE can provide predicates to identify which variables are created by the lowering for wildcards. We already have other predicates for other lowerings in this file: https://github.com/dart-lang/sdk/blob/main/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart
@kallentu It will be helpful if the CFE can provide predicates to identify which variables are created by the lowering for wildcards. We already have other predicates for other lowerings in this file: https://github.com/dart-lang/sdk/blob/main/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart
Noted. Haven't changed CFE to have unique lowered names yet. I'll comment on this issue again when I make progress.
The CL that lowers wildcard variable names into unique names https://github.com/dart-lang/sdk/commit/1d527619505dbce25a2822951f84294a14584b57 has now been submitted.
https://github.com/dart-lang/sdk/blob/main/pkg/front_end/lib/src/kernel/wildcard_lowering.dart are where the wildcard predicates and name conversions are located.
These predicates are exported by https://github.com/dart-lang/sdk/blob/main/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart so you should get them if you already import this file.
Let me know if you need anything else or anything should be changed. Happy to do so.
Otherwise, CFE implementation is complete and ready for any web debugging work.
Looks like wildcards are being hidden correctly on web: