aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
commitafa87af01c79a9baa539f2992d32154d2a4739bd (patch)
tree92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js
parent3b927e84d200402281f68181cd4253bc77e5528d (diff)
downloadneko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.gz
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.bz2
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.zip
task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq
Diffstat (limited to 'vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js')
-rw-r--r--vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js104
1 files changed, 0 insertions, 104 deletions
diff --git a/vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js b/vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js
deleted file mode 100644
index a34c521..0000000
--- a/vanilla/node_modules/undici/lib/web/websocket/stream/websocketerror.js
+++ /dev/null
@@ -1,104 +0,0 @@
-'use strict'
-
-const { webidl } = require('../../webidl')
-const { validateCloseCodeAndReason } = require('../util')
-const { kConstruct } = require('../../../core/symbols')
-const { kEnumerableProperty } = require('../../../core/util')
-
-function createInheritableDOMException () {
- // https://github.com/nodejs/node/issues/59677
- class Test extends DOMException {
- get reason () {
- return ''
- }
- }
-
- if (new Test().reason !== undefined) {
- return DOMException
- }
-
- return new Proxy(DOMException, {
- construct (target, args, newTarget) {
- const instance = Reflect.construct(target, args, target)
- Object.setPrototypeOf(instance, newTarget.prototype)
- return instance
- }
- })
-}
-
-class WebSocketError extends createInheritableDOMException() {
- #closeCode
- #reason
-
- constructor (message = '', init = undefined) {
- message = webidl.converters.DOMString(message, 'WebSocketError', 'message')
-
- // 1. Set this 's name to " WebSocketError ".
- // 2. Set this 's message to message .
- super(message, 'WebSocketError')
-
- if (init === kConstruct) {
- return
- } else if (init !== null) {
- init = webidl.converters.WebSocketCloseInfo(init)
- }
-
- // 3. Let code be init [" closeCode "] if it exists , or null otherwise.
- let code = init.closeCode ?? null
-
- // 4. Let reason be init [" reason "] if it exists , or the empty string otherwise.
- const reason = init.reason ?? ''
-
- // 5. Validate close code and reason with code and reason .
- validateCloseCodeAndReason(code, reason)
-
- // 6. If reason is non-empty, but code is not set, then set code to 1000 ("Normal Closure").
- if (reason.length !== 0 && code === null) {
- code = 1000
- }
-
- // 7. Set this 's closeCode to code .
- this.#closeCode = code
-
- // 8. Set this 's reason to reason .
- this.#reason = reason
- }
-
- get closeCode () {
- return this.#closeCode
- }
-
- get reason () {
- return this.#reason
- }
-
- /**
- * @param {string} message
- * @param {number|null} code
- * @param {string} reason
- */
- static createUnvalidatedWebSocketError (message, code, reason) {
- const error = new WebSocketError(message, kConstruct)
- error.#closeCode = code
- error.#reason = reason
- return error
- }
-}
-
-const { createUnvalidatedWebSocketError } = WebSocketError
-delete WebSocketError.createUnvalidatedWebSocketError
-
-Object.defineProperties(WebSocketError.prototype, {
- closeCode: kEnumerableProperty,
- reason: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'WebSocketError',
- writable: false,
- enumerable: false,
- configurable: true
- }
-})
-
-webidl.is.WebSocketError = webidl.util.MakeTypeAssertion(WebSocketError)
-
-module.exports = { WebSocketError, createUnvalidatedWebSocketError }