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

Due to legacy behaviors of JavaScript, WebIDL has a lot of conversion rules processing its arguments, e.g. any object with `toString()` can be passed as argument to methods accepting `DOMString`.

While I understand the rationale of existing implementation having this behavior, wouldn't it make sense for new specs being developed to have stricter type checking on their methods? e.g. methods accepting `DOMString` should throw `TypeError` if `typeof obj !== 'string'`.

This could be defined as extended attribute at the interface or method level so that it doesn't affect existing specs.

-- 
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

Received on Monday, 17 July 2017 10:30:22 UTC