Skip to content

Commit

Permalink
DOMException: test code mapping for all error names
Browse files Browse the repository at this point in the history
In particular, this tests the deprecated ones, some removed ones, and some newer error names which intentionally don't have legacy error codes. See also whatwg/webidl#946.

Closes #27151.
  • Loading branch information
kt3k authored Jan 15, 2021
1 parent 262bf7f commit 93c6fac
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,33 @@ test(function() {
{name: "InvalidModificationError", code: 13},
{name: "NamespaceError", code: 14},
{name: "InvalidAccessError", code: 15},
{name: "TypeMismatchError", code: 17},
{name: "SecurityError", code: 18},
{name: "NetworkError", code: 19},
{name: "AbortError", code: 20},
{name: "URLMismatchError", code: 21},
{name: "QuotaExceededError", code: 22},
{name: "TimeoutError", code: 23},
{name: "InvalidNodeTypeError", code: 24},
{name: "DataCloneError", code: 25}
{name: "DataCloneError", code: 25},

// These were removed from the error names table.
// See https://github.com/heycam/webidl/pull/946.
{name: "DOMStringSizeError", code: 0},
{name: "NoDataAllowedError", code: 0},
{name: "ValidationError", code: 0},

// The error names which don't have legacy code values.
{name: "EncodingError", code: 0},
{name: "NotReadableError", code: 0},
{name: "UnknownError", code: 0},
{name: "ConstraintError", code: 0},
{name: "DataError", code: 0},
{name: "TransactionInactiveError", code: 0},
{name: "ReadOnlyError", code: 0},
{name: "VersionError", code: 0},
{name: "OperationError", code: 0},
{name: "NotAllowedError", code: 0}
].forEach(function(test_case) {
test(function() {
var ex = new DOMException("msg", test_case.name);
Expand Down

0 comments on commit 93c6fac

Please sign in to comment.