Open
Description
Per http://heycam.github.io/webidl/#es-exception-objects and http://heycam.github.io/webidl/#es-DOMException-prototype-object DOMException should be a subclass of Error and therefore have name
and message
properties.
Sample:
/** @param {DOMException} error */
function showError(error) {
console.log(error.name);
console.log(error.message);
}
Closure Compiler service reports:
JSC_INEXISTENT_PROPERTY: Property name never defined on DOMException at line 3 character 20
console.log(error.name);
^
JSC_INEXISTENT_PROPERTY: Property message never defined on DOMException at line 4 character 20
console.log(error.message);
^
Also note that code
is intended to be an own-property not necessarily a getter on the prototype, but this is not clearly specified at the moment, and browsers (e.g. Chrome) may implement it as an inherited getter.