Skip to content

Commit afc4a3f

Browse files
committed
Update DOMException API
* Add new error sets. * Reorder error sets in numeric order. So we can add new error sets easily in the future.
1 parent 0ede725 commit afc4a3f

File tree

1 file changed

+35
-18
lines changed

1 file changed

+35
-18
lines changed

src/main/scala/org/scalajs/dom/raw/lib.scala

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6665,45 +6665,62 @@ abstract class CharacterData extends Node with NonDocumentTypeChildNode {
66656665
class DOMException extends js.Object {
66666666

66676667
/**
6668-
* Readonly short. Returns one of the exception code constants (see below).
6669-
* Deprecated use DOMError.name instead.
6668+
* Returns a short that contains one of the error code constants one of the
6669+
* exception code constants (see below) or 0 if none match. This field is used
6670+
* for historical reasons. New DOM exceptions don't use this anymore: they put
6671+
* this info in the name attribute.
66706672
*
66716673
* MDN
66726674
*/
66736675
@deprecated("Obsolete.", "DOM4")
66746676
def code: Int = js.native
66756677

6678+
/**
6679+
* Returns a DOMString representing a message or description associated with
6680+
* the given error name.
6681+
*
6682+
* MDN
6683+
*/
66766684
def message: String = js.native
6685+
6686+
/**
6687+
* Returns a DOMString that contains one of the strings associated with an
6688+
* error name.
6689+
*
6690+
* MDN
6691+
*/
6692+
def name: String = js.native
66776693
}
66786694

66796695
@js.native
66806696
@JSGlobal
66816697
object DOMException extends js.Object {
66826698

6699+
val INDEX_SIZE_ERR: Int = js.native
6700+
val DOMSTRING_SIZE_ERR: Int = js.native
66836701
val HIERARCHY_REQUEST_ERR: Int = js.native
6702+
val WRONG_DOCUMENT_ERR: Int = js.native
6703+
val INVALID_CHARACTER_ERR: Int = js.native
6704+
val NO_DATA_ALLOWED_ERR: Int = js.native
66846705
val NO_MODIFICATION_ALLOWED_ERR: Int = js.native
6706+
val NOT_FOUND_ERR: Int = js.native
6707+
val NOT_SUPPORTED_ERR: Int = js.native
6708+
val INUSE_ATTRIBUTE_ERR: Int = js.native
6709+
val INVALID_STATE_ERR: Int = js.native
6710+
val SYNTAX_ERR: Int = js.native
66856711
val INVALID_MODIFICATION_ERR: Int = js.native
66866712
val NAMESPACE_ERR: Int = js.native
6687-
val INVALID_CHARACTER_ERR: Int = js.native
6713+
val INVALID_ACCESS_ERR: Int = js.native
6714+
val VALIDATION_ERR: Int = js.native
66886715
val TYPE_MISMATCH_ERR: Int = js.native
6689-
val ABORT_ERR: Int = js.native
6690-
val INVALID_STATE_ERR: Int = js.native
66916716
val SECURITY_ERR: Int = js.native
66926717
val NETWORK_ERR: Int = js.native
6693-
val WRONG_DOCUMENT_ERR: Int = js.native
6694-
val QUOTA_EXCEEDED_ERR: Int = js.native
6695-
val INDEX_SIZE_ERR: Int = js.native
6696-
val DOMSTRING_SIZE_ERR: Int = js.native
6697-
val SYNTAX_ERR: Int = js.native
6698-
val SERIALIZE_ERR: Int = js.native
6699-
val VALIDATION_ERR: Int = js.native
6700-
val NOT_FOUND_ERR: Int = js.native
6718+
val ABORT_ERR: Int = js.native
67016719
val URL_MISMATCH_ERR: Int = js.native
6702-
val PARSE_ERR: Int = js.native
6703-
val NO_DATA_ALLOWED_ERR: Int = js.native
6704-
val NOT_SUPPORTED_ERR: Int = js.native
6705-
val INVALID_ACCESS_ERR: Int = js.native
6706-
val INUSE_ATTRIBUTE_ERR: Int = js.native
6720+
val QUOTA_EXCEEDED_ERR: Int = js.native
6721+
val TIMEOUT_ERR: Int = js.native
6722+
val INVALID_NODE_TYPE_ERR: Int = js.native
6723+
val DATA_CLONE_ERR: Int = js.native
67076724
}
67086725

67096726
/**

0 commit comments

Comments
 (0)