Skip to content

Add webidl optional support to web-sys #502

Closed
@richard-uk1

Description

@richard-uk1

Currently optional parameters are forced. I think they should be an Option<T>.

This depends on #14 to generate the correct glue code, provided the way options are represented in the end is compatible with these APIs.

Also, in the spec, optional parameters can have a default. This doesn't really affect the rust function, but it could be mentioned in some generated documentation, perhaps.

WebIDL snippet from the Console api (console.*):

[UseCounter]
void count(optional DOMString label = "default");

EDITS

  • 2018-07-18 Added more detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions