Moving this existing helper from Console (idl) to ChromeUtils (WebIdl)
in order to be able to use aRv.MightThrowJSException and aRv.ThrowJSException
which are key ingredients to be able to re-throw the intercepted exception.
Differential Revision: https://phabricator.services.mozilla.com/D233548