Sha256: df65a6f6189bb83bc41670da37679b87ac479b7a960fb2a862d029a0b9c37ee6
Contents?: true
Size: 624 Bytes
Versions: 32
Compression:
Stored size: 624 Bytes
Contents
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
32 entries across 27 versions & 12 rubygems