* @see https://websockets.spec.whatwg.org/#dom-websocket-close * @param {number|undefined} code * @param {string|undefined} reason
(code = void 0, reason = void 0)
| 15976 | * @param {string|undefined} reason |
| 15977 | */ |
| 15978 | close(code = void 0, reason = void 0) { |
| 15979 | webidl.brandCheck(this, _WebSocket); |
| 15980 | const prefix = "WebSocket.close"; |
| 15981 | if (code !== void 0) { |
| 15982 | code = webidl.converters["unsigned short"](code, prefix, "code", webidl.attributes.Clamp); |
| 15983 | } |
| 15984 | if (reason !== void 0) { |
| 15985 | reason = webidl.converters.USVString(reason); |
| 15986 | } |
| 15987 | code ??= null; |
| 15988 | reason ??= ""; |
| 15989 | closeWebSocketConnection(this.#handler, code, reason, true); |
| 15990 | } |
| 15991 | /** |
| 15992 | * @see https://websockets.spec.whatwg.org/#dom-websocket-send |
| 15993 | * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data |
nothing calls this directly
no test coverage detected