Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/ws/lib/event-target.js

    r59329aa re29cc2e  
    1111   *
    1212   * @param {String} type The name of the event
    13    * @param {Object} target A reference to the target to which the event was
    14    *     dispatched
     13   * @param {Object} target A reference to the target to which the event was dispatched
    1514   */
    1615  constructor(type, target) {
     
    3130   *
    3231   * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data
    33    * @param {WebSocket} target A reference to the target to which the event was
    34    *     dispatched
     32   * @param {WebSocket} target A reference to the target to which the event was dispatched
    3533   */
    3634  constructor(data, target) {
     
    5149   * Create a new `CloseEvent`.
    5250   *
    53    * @param {Number} code The status code explaining why the connection is being
    54    *     closed
    55    * @param {String} reason A human-readable string explaining why the
    56    *     connection is closing
    57    * @param {WebSocket} target A reference to the target to which the event was
    58    *     dispatched
     51   * @param {Number} code The status code explaining why the connection is being closed
     52   * @param {String} reason A human-readable string explaining why the connection is closing
     53   * @param {WebSocket} target A reference to the target to which the event was dispatched
    5954   */
    6055  constructor(code, reason, target) {
     
    7772   * Create a new `OpenEvent`.
    7873   *
    79    * @param {WebSocket} target A reference to the target to which the event was
    80    *     dispatched
     74   * @param {WebSocket} target A reference to the target to which the event was dispatched
    8175   */
    8276  constructor(target) {
     
    9690   *
    9791   * @param {Object} error The error that generated this event
    98    * @param {WebSocket} target A reference to the target to which the event was
    99    *     dispatched
     92   * @param {WebSocket} target A reference to the target to which the event was dispatched
    10093   */
    10194  constructor(error, target) {
     
    117110   * Register an event listener.
    118111   *
    119    * @param {String} type A string representing the event type to listen for
     112   * @param {String} method A string representing the event type to listen for
    120113   * @param {Function} listener The listener to add
    121    * @param {Object} [options] An options object specifies characteristics about
    122    *     the event listener
    123    * @param {Boolean} [options.once=false] A `Boolean`` indicating that the
    124    *     listener should be invoked at most once after being added. If `true`,
    125    *     the listener would be automatically removed when invoked.
    126114   * @public
    127115   */
    128   addEventListener(type, listener, options) {
     116  addEventListener(method, listener) {
    129117    if (typeof listener !== 'function') return;
    130118
     
    145133    }
    146134
    147     const method = options && options.once ? 'once' : 'on';
    148 
    149     if (type === 'message') {
     135    if (method === 'message') {
    150136      onMessage._listener = listener;
    151       this[method](type, onMessage);
    152     } else if (type === 'close') {
     137      this.on(method, onMessage);
     138    } else if (method === 'close') {
    153139      onClose._listener = listener;
    154       this[method](type, onClose);
    155     } else if (type === 'error') {
     140      this.on(method, onClose);
     141    } else if (method === 'error') {
    156142      onError._listener = listener;
    157       this[method](type, onError);
    158     } else if (type === 'open') {
     143      this.on(method, onError);
     144    } else if (method === 'open') {
    159145      onOpen._listener = listener;
    160       this[method](type, onOpen);
     146      this.on(method, onOpen);
    161147    } else {
    162       this[method](type, listener);
     148      this.on(method, listener);
    163149    }
    164150  },
     
    167153   * Remove an event listener.
    168154   *
    169    * @param {String} type A string representing the event type to remove
     155   * @param {String} method A string representing the event type to remove
    170156   * @param {Function} listener The listener to remove
    171157   * @public
    172158   */
    173   removeEventListener(type, listener) {
    174     const listeners = this.listeners(type);
     159  removeEventListener(method, listener) {
     160    const listeners = this.listeners(method);
    175161
    176     for (let i = 0; i < listeners.length; i++) {
     162    for (var i = 0; i < listeners.length; i++) {
    177163      if (listeners[i] === listener || listeners[i]._listener === listener) {
    178         this.removeListener(type, listeners[i]);
     164        this.removeListener(method, listeners[i]);
    179165      }
    180166    }
Note: See TracChangeset for help on using the changeset viewer.