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

domenic 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|.

> Are you aware of an existing case to inform the decision?

I'm not aware of any. However I generally think aligning with promise.then() will be more intuitive for spec authors, if we have that degree of freedom. So I'd prefer that if possible.

> 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?

Definitely.

-- 
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_r320823311

Received on Wednesday, 4 September 2019 15:24:43 UTC