From 93c6faceda56025f1c96c0155990bf1d231dac9c Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sat, 16 Jan 2021 02:42:37 +0900 Subject: [PATCH] DOMException: test code mapping for all error names 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 https://github.com/heycam/webidl/pull/946. Closes #27151. --- .../DOMException-constructor-behavior.any.js | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.js b/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.js index d6e1cdd451ca8d..e9917af2287490 100644 --- a/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.js +++ b/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.js @@ -100,6 +100,7 @@ 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}, @@ -107,7 +108,25 @@ test(function() { {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);