diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 8aca631c..bf37b1fe 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -1040,12 +1040,12 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [ 1. [=list/Append=] [=ToWebAssemblyValue=](|arg|, |t|) to |args|. 1. Set |i| to |i| + 1. 1. Let (|store|, |ret|) be the result of [=func_invoke=](|store|, |funcaddr|, |args|). - 1. Note: The expectation is that [=func_invoke=] will be updated to return (|store|, val* | [=error=] | (exception |exntag| |payload|)). + 1. Note: The expectation is that [=func_invoke=] will be updated to return (|store|, val* | [=error=] | (exception |exntag| |payload| |opaqueData|)). 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. 1. If |ret| is [=error=], throw an exception. This exception should be a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by the WebAssembly error mapping. - 1. If |ret| is exception |exntag| |payload|, then - 1. If |exntag| is the [=JavaScript exception tag=], then - 1. Let « [=ref.extern=] |externaddr| » be |payload|. + 1. If |ret| is exception |exntag| |payload| |opaqueData|, then + 1. If |opaqueData| is not [=ref.null=] [=externref=], + 1. Let « [=ref.extern=] |externaddr| » be |opaqueData|. 1. Throw the result of [=retrieving an extern value=] from |externaddr|. 1. Let |exception| be [=create an Exception object|a new Exception=] for |exntag| and |payload|. 1. Throw |exception|. @@ -1107,8 +1107,9 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not 1. Let |payload| be |v|.\[[Payload]]. 1. Otherwise, 1. Let |type| be the [=JavaScript exception tag=]. - 1. Let |payload| be [=ToWebAssemblyValue=](|v|, [=externref=]). - 1. [=WebAssembly/Throw=] with |type| and |payload|. + 1. Let |payload| be « ». + 1. Let |opaqueData| be [=ToWebAssemblyValue=](|v|, [=externref=]) + 1. [=WebAssembly/Throw=] with |type|, |payload| and |opaqueData|. 1. Otherwise, return |result|.\[[Value]]. 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|). @@ -1258,11 +1259,16 @@ Advisement: This method is only expected to be implemented or shipped when both
+dictionary ExceptionOptions { + boolean traceStack = false; +}; + [LegacyNamespace=WebAssembly, Exposed=(Window,Worker,Worklet)] interface Exception { - constructor(Tag exceptionTag, sequence<any> payload); + constructor(Tag exceptionTag, sequence<any> payload, optional ExceptionOptions options = {}); any getArg(Tag exceptionTag, unsigned long index); boolean is(Tag exceptionTag); + readonly attribute (DOMString or undefined) stack; };@@ -1270,8 +1276,8 @@ An {{Exception}} value represents an exception.