dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
213 stars 71 forks source link

`late` fields are obfuscated in the debugger #2440

Closed elliette closed 2 weeks ago

elliette commented 1 month ago

Example:

Screenshot 2024-05-28 at 3 06 50 PM

See cl/637897346 for context.

Some notes:

late fields used to be de-obfuscated by DWDS: https://github.com/dart-lang/webdev/pull/1355

This was removed in https://github.com/dart-lang/webdev/pull/2159 and replaced with the DDC runtime debugger API's getObjectFieldNames method.

I see that the DDC runtime API does try to handle late fields: https://github.com/dart-lang/sdk/blob/1a9acb9171a4a6b69d5e537438d3191ff59cd6da/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/debugger.dart#L546-L549

FYI @nshahan @Markzipan

nshahan commented 4 weeks ago

I've landed fixes for late local variables with these two changes (I think that is what we were discussing with this issue).

There is technically DDC uses a different representation for class fields, and library level fields so those should be considered independently from each other and from the local variables.