Update event-target.js

This commit is contained in:
ZyLacx 2021-12-27 17:16:05 +01:00
parent 602164d831
commit fa31df4cc6

29
node_modules/ws/lib/event-target.js generated vendored
View file

@ -10,7 +10,8 @@ class Event {
* Create a new `Event`. * Create a new `Event`.
* *
* @param {String} type The name of the event * @param {String} type The name of the event
* @param {Object} target A reference to the target to which the event was dispatched * @param {Object} target A reference to the target to which the event was
* dispatched
*/ */
constructor(type, target) { constructor(type, target) {
this.target = target; this.target = target;
@ -29,7 +30,8 @@ class MessageEvent extends Event {
* Create a new `MessageEvent`. * Create a new `MessageEvent`.
* *
* @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data
* @param {WebSocket} target A reference to the target to which the event was dispatched * @param {WebSocket} target A reference to the target to which the event was
* dispatched
*/ */
constructor(data, target) { constructor(data, target) {
super('message', target); super('message', target);
@ -48,9 +50,12 @@ class CloseEvent extends Event {
/** /**
* Create a new `CloseEvent`. * Create a new `CloseEvent`.
* *
* @param {Number} code The status code explaining why the connection is being closed * @param {Number} code The status code explaining why the connection is being
* @param {String} reason A human-readable string explaining why the connection is closing * closed
* @param {WebSocket} target A reference to the target to which the event was dispatched * @param {String} reason A human-readable string explaining why the
* connection is closing
* @param {WebSocket} target A reference to the target to which the event was
* dispatched
*/ */
constructor(code, reason, target) { constructor(code, reason, target) {
super('close', target); super('close', target);
@ -71,7 +76,8 @@ class OpenEvent extends Event {
/** /**
* Create a new `OpenEvent`. * Create a new `OpenEvent`.
* *
* @param {WebSocket} target A reference to the target to which the event was dispatched * @param {WebSocket} target A reference to the target to which the event was
* dispatched
*/ */
constructor(target) { constructor(target) {
super('open', target); super('open', target);
@ -89,7 +95,8 @@ class ErrorEvent extends Event {
* Create a new `ErrorEvent`. * Create a new `ErrorEvent`.
* *
* @param {Object} error The error that generated this event * @param {Object} error The error that generated this event
* @param {WebSocket} target A reference to the target to which the event was dispatched * @param {WebSocket} target A reference to the target to which the event was
* dispatched
*/ */
constructor(error, target) { constructor(error, target) {
super('error', target); super('error', target);
@ -111,11 +118,11 @@ const EventTarget = {
* *
* @param {String} type A string representing the event type to listen for * @param {String} type A string representing the event type to listen for
* @param {Function} listener The listener to add * @param {Function} listener The listener to add
* @param {Object} options An options object specifies characteristics about * @param {Object} [options] An options object specifies characteristics about
* the event listener * the event listener
* @param {Boolean} options.once A `Boolean`` indicating that the listener * @param {Boolean} [options.once=false] A `Boolean`` indicating that the
* should be invoked at most once after being added. If `true`, the * listener should be invoked at most once after being added. If `true`,
* listener would be automatically removed when invoked. * the listener would be automatically removed when invoked.
* @public * @public
*/ */
addEventListener(type, listener, options) { addEventListener(type, listener, options) {