Re: [heycam/webidl] Handle conversion failures in 'upon settling'. (#791)

Ms2ger commented on this pull request.



> @@ -8236,8 +8236,15 @@ IDL [=promise type=] values are represented by ECMAScript [=PromiseCapability=]
     steps:
 
     1.  Let |onFulfilledSteps| be the following steps given argument |V|:
-        1.  Let |value| be the result of [=converted to an IDL value|converting=] |V| to an IDL
-            value of type |T|.
+        1.  Try running the following step:
+            1.  Let |value| be the result of [=converted to an IDL value|converting=] |V| to an IDL
+                value of type |T|.
+
+            And then, if <a lt="an exception was thrown">an exception |exception| was thrown</a>:
+
+            1.  If there are steps that are required to be run if the promise was rejected, let
+                |result| be the result of performing those steps, given |exception|.

Hm, good question. This matters if:

1. we want to do a type conversion
1. the returned promise is used (former "transforming")
1. we want to do something else than passing the rejection along

Are you aware of an existing case to inform the decision? From https://github.com/heycam/webidl/issues/782#issuecomment-526519971, `waitUntil`/`complete` fail (1), `respondWith`/`updateWith` fail (2), WebAssembly fails (3).

Writing this, I'm realizing that we never actually pass the rejection along, the way WebAssembly needs. Should we pass **undefined** instead of `onRejectedSteps` if there's no steps?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/791#discussion_r320643831

Received on Wednesday, 4 September 2019 08:50:34 UTC