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

Can a required argument exist after an optional argument? #1214

Open
saschanaz opened this issue Oct 10, 2022 · 1 comment
Open

Can a required argument exist after an optional argument? #1214

saschanaz opened this issue Oct 10, 2022 · 1 comment

Comments

@saschanaz
Copy link
Member

Long time ago there was this restriction added in 2011:

webidl/Overview.xml

Lines 1391 to 1396 in 3785917

<p>
Web IDL operations do not support being called with omitted optional arguments
unless all subsequent optional arguments are also omitted. Bindings for
languages that do support function calling in this way will fail such
calls in a language binding specific manner.
</p>

This was lifted in 2013 by 97499d4, but I don't think it was well advertised and at least one parser still disallows this: #1211 (comment)

I think we need to double check and add an explicit phrase about whether this is allowed or disallowed.

@saschanaz saschanaz changed the title Can a required argument be after an optional argument? Can a required argument exist after an optional argument? Oct 10, 2022
@domenic
Copy link
Member

domenic commented Oct 11, 2022

Thanks for the detective work!

I'm not sure we need an explicit phrase; it seems like we just need to fix buggy parsers. But maybe a note would be helpful, indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants