'$this' appears in variables window on a breakpoint inside an extension method
- Dominant language
- Dart
- Stars
- 224
- Forks
- 94
- Avg merge
- 7h 14m
- Merged PRs (30d)
- 2
Description
`$this` is a JS name for dart `this` - need to use debug symbols to map it properly.
Not sure where `return` variable is coming from, it should not be visible either (it is not in VM).
Related: https://github.com/dart-lang/webdev/issues/1371
Possible workaround: remove `$` in the display window for now.
@nshahan some ddc questions:
- would it break any other cases, for example, can `$this` exist at all in dart, or map to something other than `this`?
- can we apply this in general, i.e. will removing `$` from JS name always map to its dart name?

Contributor guide
Research direction
Start by reproducing the breakpoint inside a Dart extension method and inspect how the variables window uses debug symbols for JavaScript names. The issue is done when Dart `this` is shown instead of `$this`, the unexpected `return` variable is hidden, and the behavior of removing `$` is validated against the listed DDC cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100