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

Give a default value for MediaMetadata constructor #238

Closed
ChunMinChang opened this issue Sep 19, 2019 · 1 comment
Closed

Give a default value for MediaMetadata constructor #238

ChunMinChang opened this issue Sep 19, 2019 · 1 comment

Comments

@ChunMinChang
Copy link
Member

By the definition of the optional argument:

If the type of an argument is a dictionary type or a union type that has a dictionary type as one of its flattened member types, and that dictionary type and its ancestors have no required members, and the argument is either the final argument or is followed only by optional arguments, then the argument must be specified as optional and have a default value provided.

Dictionary argument without any required fields need to have a default value. Hence

Constructor(optional MediaMetadataInit init)

should be replaced by

Constructor(optional MediaMetadataInit init = {})

Given that the extended attributes for Constructor is replaced by the new constructor() syntax(#235), the Constructor should be moved in the MediaMetadata interface and replaced by

constructor(optional MediaMetadataInit init = {})
ChunMinChang added a commit to ChunMinChang/mediasession that referenced this issue Sep 19, 2019
mounirlamouri pushed a commit that referenced this issue Sep 20, 2019
* Use new constructor() syntax

This solves #235

* Give default value for MediaMetadata constructor

This solves #238
@ChunMinChang
Copy link
Member Author

Fixed in #236

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

No branches or pull requests

1 participant