Re: [heycam/webidl] undefined can't be a member of a union type (#962)

If you insert a rule at the top of the union conversion that `If the union type includes the undefined type and V is undefined, then return the IDL value undefined`, then that allows unions that treat `null` and `undefined` as separate values (just need to also include a nullable type in the union). If one wants `null` and `undefined` to be treated the same, then just don't include `undefined` in the union. The algorithm then falls back to `If the union type includes a nullable type and V is null or undefined, then return the IDL value null`. It's not great for distinguishability (`null` and `undefined` are distinguishable but also not?), but I think that because of the existing conversion behaviour it's hard to reconcile both. Unless you hide that behind something like `[LegacyUndefinedToNull]`, but that seems pretty daunting.

-- 
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/962#issuecomment-799584325

Received on Monday, 15 March 2021 17:03:34 UTC