Skip to content

Migrate debugger instance helper to null safety #1677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

annagrin
Copy link
Contributor

@annagrin annagrin commented Jul 8, 2022

Migrate debugger/instance.dart helper to null safety

Towards: #1327

@annagrin annagrin requested review from elliette and grouma July 11, 2022 20:30
properties.sublist(0, min(count ?? length, numberOfProperties));
: (await instanceRefFor(remoteObject))?.length;
final indexed = properties.sublist(
0, min(count ?? length ?? numberOfProperties, numberOfProperties));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this whole block of code from line 278 - 283 was already here before the null-safety migration, but trying to follow everything going on is pretty confusing. Maybe we could pull this out into a couple helper methods (e.g., _getPropertiesSublist if offset and count are set, and _getAllProperties if not)? Also are we using offset anywhere? I would think it should be the first argument to .sublist if it's defined.

Copy link
Contributor Author

@annagrin annagrin Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be ok to do it in a separate PR? This way we could figure out what the offset is for and add some tests as well, without mixing too many changes in the null-safety migration PR.

Copy link
Contributor

@elliette elliette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one comment. Thanks!

@annagrin annagrin merged commit 95ce058 into dart-lang:master Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants