dart-lang / dart-lang/webdev

'$this' appears in variables window on a breakpoint inside an extension method

Open
#1,372 2 comments 0 reactions 0 assignees View on GitHub
P2 symbols
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?

![image](https://user-images.githubusercontent.com/12737689/127556486-d32f707c-8435-4d83-9ba7-4c9496d19469.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.