-
Notifications
You must be signed in to change notification settings - Fork 87
Migrate the Dart Debug Extension to null-safety #1655
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
Conversation
annagrin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Elliott! some small comments...
| client.stream.listen((data) { | ||
| final message = serializers.deserialize(jsonDecode(data)); | ||
| if (message is ExtensionRequest) { | ||
| final messageParams = message.commandParams ?? ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be '{}'? I think json.decode will throw on an empty string...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point! Done
|
|
||
| @JS() | ||
| @anonymous | ||
| class ScriptIdParam { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used? I couldn't find any explicit references in this file but maybe the use is implicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I don't think this is being used anywhere. Removed
| external String get recipient; | ||
| external String get body; | ||
| external factory SimpleMessage({String recipient, String body}); | ||
| external factory SimpleMessage({String? recipient, String? body}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious - what happens if those parameters are non-null? Is it not possible to use them in interop then? Same question for other JS types we have in this file that we never pass nulls to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean null? Not sure, but I've switched to non-null since we always pass in a non null arg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant "can all the parameters be non-null?" For example, external factory SimpleMessage({String recipient, String body});. In this and some other external methods we never pass nulls. Does it not compile or fail at runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made all parameters non-null if we don't pass in null values. Interestingly enough, this doesn't seem to have any effect on the dart2js compiled output.
annagrin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Elliott, LGTM!
No description provided.