Re: [heycam/webidl] Strict type checking in WebIDL (#383)

String is just one of the examples, and the exact approach and rules can be up for discussion. I just want to see if there is any interest in similar stricter type checking improvement. 

I think passing arguments of the wrong type to APIs is often unintentional and is a source of bugs, so it is better to throw error instead of silently coercing it. The rationale is similar to `[EnforceRange]`, where it allows modern APIs to throw certain class of errors that are originally ignored.

If augmenting the behavior of existing types through extended attribute is undesirable, then perhaps an approach similar to #33 can be used to introduce new types that have simpler type checking / coercion rules?

-- 
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/383#issuecomment-315950147

Received on Tuesday, 18 July 2017 03:47:35 UTC