ERR', 17);
  fn('SecurityError', 'SECURITY_ERR', 18);
  fn('NetworkError', 'NETWORK_ERR', 19);
  fn('AbortError', 'ABORT_ERR', 20);
  fn('URLMismatchError', 'URL_MISMATCH_ERR', 21);
  fn('QuotaExceededError', 'QUOTA_EXCEEDED_ERR', 22);
  fn('TimeoutError', 'TIMEOUT_ERR', 23);
  fn('InvalidNodeTypeError', 'INVALID_NODE_TYPE_ERR', 24);
  fn('DataCloneError', 'DATA_CLONE_ERR', 25);
  // There are some more error names, but since they don't have codes assigned,
  // we don't need to care about them.
}

forEachCode((name, codeName, value) => {
  const desc = { enumerable: true, value };
  ObjectDefineProperty(DOMException, codeName, desc);
  ObjectDefineProperty(DOMException.prototype, codeName, desc);
});

exports.DOMException = DOMException;
