Skip to content

Conversation

@elliette
Copy link
Contributor

No description provided.

@elliette elliette requested a review from annagrin June 14, 2022 22:02
Copy link
Contributor

@annagrin annagrin left a 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 ?? '';
Copy link
Contributor

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...

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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});
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@annagrin annagrin Jun 17, 2022

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@annagrin annagrin left a comment

Choose a reason for hiding this comment

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

Thanks Elliott, LGTM!

@elliette elliette merged commit 2c84bf1 into dart-lang:master Jun 23, 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