script: Add a Constraint DOMException for IndexedDB (#37605)

Add Constraint DOMException to handle the name conflict error in
`IDBDatabase::createObjectStore` method.

Testing: `./mach test-wpt tests/wpt/tests/IndexedDB/`, but it seems
there are many test failures even in main branch already ([related
comment](https://github.com/servo/servo/pull/37605#issuecomment-2993889163)).
Fixes: #37571

---------

Signed-off-by: iamlockon <xdddxyyyxzzz123@gmail.com>
This commit is contained in:
Jay Wang 2025-07-12 19:08:40 +09:00 committed by GitHub
parent 12d262ec23
commit 204af81d2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 2 deletions

View file

@ -98,6 +98,7 @@ pub(crate) fn throw_dom_exception(
Error::Operation => DOMErrorName::OperationError,
Error::NotAllowed => DOMErrorName::NotAllowedError,
Error::Encoding => DOMErrorName::EncodingError,
Error::Constraint => DOMErrorName::ConstraintError,
Error::Type(message) => unsafe {
assert!(!JS_IsExceptionPending(*cx));
throw_type_error(*cx, &message);