bindings: Convert certain Exceptions into Promise rejections (#32923)

* Impl promise exception to rejection for methods

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Impl promise exception to rejection for getters

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Impl promise exception to rejection for static methods

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add tests for exception to rejection

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-08-03 14:58:37 +02:00 committed by GitHub
parent fd83281657
commit f3bec0aed3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 291 additions and 20 deletions

View file

@ -574,6 +574,16 @@ interface TestBinding {
undefined promiseRejectWithTypeError(Promise<any> p, USVString message);
undefined resolvePromiseDelayed(Promise<any> p, DOMString value, unsigned long long ms);
[Throws]
static Promise<any> staticThrowToRejectPromise();
[Throws]
Promise<any> methodThrowToRejectPromise();
[Throws]
readonly attribute Promise<any> getterThrowToRejectPromise;
static Promise<any> staticInternalThrowToRejectPromise([EnforceRange] unsigned long long arg);
Promise<any> methodInternalThrowToRejectPromise([EnforceRange] unsigned long long arg);
undefined panic();
GlobalScope entryGlobal();