Skip to content
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

Migrate dwds/web directory to null safety #1648

Merged
merged 5 commits into from
Jun 13, 2022

Conversation

annagrin
Copy link
Contributor

@annagrin annagrin commented Jun 13, 2022

Migrate dwds/web directory to null safety

Towards: #1327

@annagrin annagrin requested review from grouma and elliette June 13, 2022 19:09
}
});
return reloadCompleter.future;
return reloadCompleter.future.then((value) {
sub.cancel();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this moved into the then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the sub is not defined inside the callback to window.onMessage.listen yet (at least analyzer does not think so:) - so i moved it to where it logically behaves the same but cancels the sub as before.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see. Hmm, could the subscription be late (so we would follow the pattern as before)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it does not help unfortunately. I know this pattern is given as an example in many places but the analyzer is rejecting it currently (and I tend to agree with it, even just for safety, don't want the wrong pointer to be pinned here:)

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.

Some small suggestions, thanks!

@annagrin annagrin requested a review from elliette June 13, 2022 21:49
@annagrin annagrin merged commit 48f93d7 into dart-lang:master Jun 13, 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