Re: [heycam/webidl] Given [Constructor, Constructor(DOMString x)], new C(undefined) picks the second (#351)

This behavior was deliberately used with `alert()` + `alert(DOMString message)` in https://github.com/whatwg/html/commit/0b570cf14d1ac33d7e7854114342ebd8c8ea624f.

Here Blink's IDL now [matches the spec](https://chromium.googlesource.com/chromium/src/+/784a562a06cb594ee8164fc191017529270988c3), but there are [other cases](https://bugs.chromium.org/p/chromium/issues/detail?id=701539) of optional vs. override mismatches that might be observable. @mdittmer, would you be able to interrogate your dataset to find all such cases?

I think that to just "trim trailing undefineds" wouldn't work, certainly if `foo(DOMString x)` is the only signature, then `foo(undefined)` shouldn't throw because of too few arguments. Maybe it would work to drop trailing undefineds down to the minimum number of arguments in any override, but I'm not sure.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/351#issuecomment-297241632

Received on Wednesday, 26 April 2017 05:27:31 UTC