You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously it was returning rejected promises, but this method does not return promises, so it should throw the exceptions instead.
I considered instead returning an immediately-errored ReadableStream. This seems a bit nicer, but a lot of precedent on the web platform points toward throwing. (Actually, most precedent is for methods returning a promise for a ReadableStream, and returning a rejected promise. I cannot find any methods that currently return a ReadableStream synchronously. But throwing is the sync analogue of returning a rejected promise.)
Copy file name to clipboardExpand all lines: index.bs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -620,11 +620,11 @@ The <dfn attribute for="AISummarizer">length</dfn> getter steps are to return [=
620
620
<div algorithm>
621
621
The <dfn method for="AISummarizer">summarizeStreaming(|input|, |options|)</dfn> method steps are:
622
622
623
-
1. If [=this=]'s [=relevant global object=] is a {{Window}} whose [=associated Document=] is not [=Document/fully active=], then return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}}.
623
+
1. If [=this=]'s [=relevant global object=] is a {{Window}} whose [=associated Document=] is not [=Document/fully active=], then throw an "{{InvalidStateError}}" {{DOMException}}.
624
624
625
-
1. If [=this=]'s [=AISummarizer/destroyed=] is true, then return [=a promise rejected with=] [=this=]'s [=AISummarizer/destruction reason=].
625
+
1. If [=this=]'s [=AISummarizer/destroyed=] is true, then throw [=this=]'s [=AISummarizer/destruction reason=].
626
626
627
-
1. If |options|["{{AISummarizerSummarizeOptions/signal}}"][=map/exists=] and is [=AbortSignal/aborted=], then return [=a promise rejected with=] |options|["{{AISummarizerSummarizeOptions/signal}}"]'s [=AbortSignal/abort reason=].
627
+
1. If |options|["{{AISummarizerSummarizeOptions/signal}}"][=map/exists=] and is [=AbortSignal/aborted=], then throw |options|["{{AISummarizerSummarizeOptions/signal}}"]'s [=AbortSignal/abort reason=].
0 commit comments