This is a very small cleanup taken from D2142. Having the CRect conversion in an own function makes it consistent with all the other JS conversions, makes it easier to focus on the conversion for the one implementing it, and makes it reusable from other places.
- rP22847: Add ToJSVal<CRect> to make the conversion reusable, remove unused…
Possibly develop an urge for better exception handling. Notice FromJSVal and the SpiderMonkey JS functions return a boolean, so it would seem logical in the long run to change ToJSVal from void to bool.