From c3b4e97982dc2bcabc63a746a69fad60cb6f3415 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Wed, 21 Jun 2023 18:56:01 -0700 Subject: [PATCH] Handle exceptions thrown while converting JS return values --- index.bs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index cd80a875..73466b90 100644 --- a/index.bs +++ b/index.bs @@ -14186,7 +14186,8 @@ the special value “missing”, which represents a missing optional argument. |callResult| and jump to the step labeled return. 1. Set |completion| to the result of [=converted to an IDL value|converting=] |callResult|.\[[Value]] to an IDL value of the same type as the operation's - return type. + return type. If this throws an exception, set |completion| to the completion value + representing the thrown exception. 1. Return: at this point |completion| will be set to an IDL value or an [=abrupt completion=]. 1. [=Clean up after running a callback=] with |stored settings|. @@ -14273,8 +14274,9 @@ described in the previous section). 1. If |callResult| is an [=abrupt completion=], set |completion| to |callResult| and jump to the step labeled return. 1. Set |completion| to the result of [=converted to an IDL value|converting=] - |callResult|.\[[Value]] to an IDL value of the same type as the operation's - return type. + |callResult|.\[[Value]] to an IDL value of the same type as |callable|'s + return type. If this throws an exception, set |completion| to the completion value + representing the thrown exception. 1. Return: at this point |completion| will be set to an IDL value or an [=abrupt completion=]. 1. [=Clean up after running a callback=] with |stored settings|. @@ -14315,8 +14317,9 @@ a return type that is a [=promise type=]. 1. If |callResult| is an [=abrupt completion=], set |completion| to |callResult| and jump to the step labeled return. 1. Set |completion| to the result of [=converted to an IDL value|converting=] - |callResult|.\[[Value]] to an IDL value of the same type as the operation's - return type. + |callResult|.\[[Value]] to an IDL value of the same type as |callable|'s + return type. If this throws an exception, set |completion| to the completion value + representing the thrown exception. 1. Return: at this point |completion| will be set to an IDL value or an [=abrupt completion=]. 1. [=Clean up after running a callback=] with |stored settings|.