From 586690b17a74de4c18f611c4e83d66f6a30f43a2 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Tue, 20 Jun 2023 14:00:40 -0700 Subject: [PATCH 1/2] Make call and invoke either return an IDL value or throw. They used to return JS Completions, contrary to the claim at their definitions. --- index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 42e8efbe..8e0bbd5d 100644 --- a/index.bs +++ b/index.bs @@ -14188,12 +14188,12 @@ the special value “missing”, which represents a missing optional argument. |callResult|.\[[Value]] to an IDL value of the same type as the operation's return type. 1. Return: at this - point |completion| will be set to an ECMAScript completion value. + point |completion| will be set to an IDL value or an [=abrupt completion=]. 1. [=Clean up after running a callback=] with |stored settings|. 1. [=Clean up after running script=] with |relevant settings|. - 1. If |completion| is a normal completion, return |completion|. + 1. If |completion| is an IDL value, return |completion|. 1. If |completion| is an [=abrupt completion=] and the operation has a [=return type=] - that is not a [=promise type=], return |completion|. + that is not a [=promise type=], throw |completion|.\[[Value]]. 1. Let |rejectedPromise| be [=!=] Call({{%Promise.reject%}}, {{%Promise%}}, «|completion|.\[[Value]]»). 1. Return the result of [=converted to an IDL value|converting=] @@ -14276,12 +14276,12 @@ described in the previous section). |callResult|.\[[Value]] to an IDL value of the same type as the operation's return type. 1. Return: at this - point |completion| will be set to an ECMAScript completion value. + point |completion| will be set to an IDL value or an [=abrupt completion=]. 1. [=Clean up after running a callback=] with |stored settings|. 1. [=Clean up after running script=] with |relevant settings|. - 1. If |completion| is a normal completion, return |completion|. + 1. If |completion| is an IDL value, return |completion|. 1. If |completion| is an [=abrupt completion=] and the callback function has a - [=return type=] that is not a [=promise type=], return |completion|. + [=return type=] that is not a [=promise type=], throw |completion|.\[[Value]]. 1. Let |rejectedPromise| be [=!=] Call({{%Promise.reject%}}, {{%Promise%}}, «|completion|.\[[Value]]»). 1. Return the result of [=converted to an IDL value|converting=] From 5d50915a1a74ec22ef86e18ba0ba94834a382368 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Tue, 20 Jun 2023 14:07:27 -0700 Subject: [PATCH 2/2] Oops, 'construct' had the same problem. --- index.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 8e0bbd5d..431a9c7e 100644 --- a/index.bs +++ b/index.bs @@ -14318,9 +14318,10 @@ a return type that is a [=promise type=]. |callResult|.\[[Value]] to an IDL value of the same type as the operation's return type. 1. Return: at this - point |completion| will be set to an ECMAScript completion value. + point |completion| will be set to an IDL value or an [=abrupt completion=]. 1. [=Clean up after running a callback=] with |stored settings|. 1. [=Clean up after running script=] with |relevant settings|. + 1. If |completion| is an [=abrupt completion=], throw |completion|.\[[Value]]. 1. Return |completion|.