Skip to content

Make WebTransportError constructor compatible #715

@achristensen07

Description

@achristensen07

Chrome seems to be currently using this:
constructor(optional WebTransportErrorInit init = {});
This allows construction with the first parameter being a dictionary, like this example from wpt:
new WebTransportError({streamErrorCode: WT_CODE}))
The current spec IDL looks like this:
constructor(optional DOMString message = "", optional WebTransportErrorOptions options = {});
This says to interpret the first parameter as a string, and if it's not a string then use the empty string, which isn't compatible with wpt or Chrome. I think we should change it to something like this:

constructor(optional WebTransportErrorOptions options = {});
constructor(DOMString message, optional WebTransportErrorOptions options = {});

This would allow us to have a dictionary as the only parameter or to have a string or a string followed by a dictionary. I'm implementing this in the initial version of WebKit/WebKit#56176

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions