Skip to content

Commit 96baeed

Browse files
committed
Mention that it has to be a WebSocketError
1 parent 1f9a2d6 commit 96baeed

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

index.bs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -876,11 +876,10 @@ initially unset.
876876
as ArrayBuffer objects.
877877

878878
The stream can be closed by calling {{ReadableStream/cancel()}} on
879-
{{WebSocketOpenInfo/readable}}. If the argument passed to {{ReadableStream/cancel()}} is an
880-
object with a {{WebSocketCloseInfo/code}} property and an <span class=allow-2119>optional</span> {{WebSocketCloseInfo/reason}}
881-
property then {{WebSocketCloseInfo/code}} will be used as [=the WebSocket connection close
882-
code=] and {{WebSocketCloseInfo/reason}} or the empty string will be used as [=the WebSocket
883-
connection close reason=].
879+
{{WebSocketOpenInfo/readable}}. If the reason argument passed to {{ReadableStream/cancel()}} is a
880+
{{WebSocketError}} object then {{WebSocketError/closeCode}} will be used as [=the WebSocket
881+
connection close code=] and {{WebSocketError/reason}} will be used as [=the WebSocket connection
882+
close reason=].
884883

885884
If no messages are read, or if messages are read slower than they are sent, then backpressure
886885
will be applied and eventually the server will stop sending new messages.
@@ -897,9 +896,9 @@ initially unset.
897896
{{WebSocketOpenInfo/writable}}.
898897

899898
The stream can also be closed by calling {{WritableStream/abort()}}
900-
{{WebSocketOpenInfo/writable}}. If an argument is passed to {{WritableStream/abort()}} then it
901-
can be used to specify [=the WebSocket connection close code=] and [=the WebSocket connection
902-
close reason=] as with {{ReadableStream/cancel()}} above.
899+
{{WebSocketOpenInfo/writable}}. If the reason passed to {{WritableStream/abort()}} is a
900+
{{WebSocketError]}}, then it will be used to set [=the WebSocket connection close code=] and
901+
[=the WebSocket connection close reason=] as with {{ReadableStream/cancel()}} above.
903902

904903
: {{WebSocketOpenInfo/extensions}}
905904
:: The [=extensions in use=] for the connection.

0 commit comments

Comments
 (0)