webidl
webidl copied to clipboard
Use RangeError rather than TypeError for enum mismatch
As per https://lists.w3.org/Archives/Public/public-script-coord/2013JulSep/0330.html this is a mismatch with JavaScript. Fixing this is a little risky, but we've successfully changed exception types in the past which makes me hopeful.
cc @littledan
FWIW ES6 changed a bunch of error classes, and I don't remember any compatibility reports in Chrome from that specifically. The extremely coarse error classes are just not very useful...
Note that we have lots more enum-style things in ECMA-402, and we like to throw RangeError. See https://tc39.github.io/ecma402/#sec-getoption
Is this still doable?
Doable? Probably. Worth the effort? Seems unlikely...