Sha256: e78b8ce0016c8de1cae04c45deb642674b7eb9ee69e3f21d746438dacd28e3f6
Contents?: true
Size: 639 Bytes
Versions: 29
Compression:
Stored size: 639 Bytes
Contents
'use strict'; var Event = require('./event'); var EventTarget = { onopen: null, onmessage: null, onerror: null, onclose: null, addEventListener: function(eventType, listener, useCapture) { this.on(eventType, listener); }, removeEventListener: function(eventType, listener, useCapture) { this.removeListener(eventType, listener); }, dispatchEvent: function(event) { event.target = event.currentTarget = this; event.eventPhase = Event.AT_TARGET; if (this['on' + event.type]) this['on' + event.type](event); this.emit(event.type, event); } }; module.exports = EventTarget;
Version data entries
29 entries across 28 versions & 9 rubygems