eventemitter3
Advanced tools
Comparing version 0.1.0 to 0.1.1
26
index.js
@@ -45,18 +45,18 @@ 'use strict'; | ||
case 1: | ||
fn.call(fn.context || this); | ||
fn.call(fn.__EE3_context || this); | ||
break; | ||
case 2: | ||
fn.call(fn.context || this, a1); | ||
fn.call(fn.__EE3_context || this, a1); | ||
break; | ||
case 3: | ||
fn.call(fn.context || this, a1, a2); | ||
fn.call(fn.__EE3_context || this, a1, a2); | ||
break; | ||
case 4: | ||
fn.call(fn.context || this, a1, a2, a3); | ||
fn.call(fn.__EE3_context || this, a1, a2, a3); | ||
break; | ||
case 5: | ||
fn.call(fn.context || this, a1, a2, a3, a4); | ||
fn.call(fn.__EE3_context || this, a1, a2, a3, a4); | ||
break; | ||
case 6: | ||
fn.call(fn.context || this, a1, a2, a3, a4, a5); | ||
fn.call(fn.__EE3_context || this, a1, a2, a3, a4, a5); | ||
break; | ||
@@ -69,6 +69,6 @@ | ||
fn.apply(fn.context || this, args); | ||
fn.apply(fn.__EE3_context || this, args); | ||
} | ||
if (fn.once) this.removeListener(event, fn); | ||
if (fn.__EE3_once) this.removeListener(event, fn); | ||
} else { | ||
@@ -80,4 +80,4 @@ for (i = 1, args = new Array(len -1); i < len; i++) { | ||
for (i = 0; i < length; fn = listeners[++i]) { | ||
fn.apply(fn.context || this, args); | ||
if (fn.once) this.removeListener(event, fn); | ||
fn.apply(fn.__EE3_context || this, args); | ||
if (fn.__EE3_once) this.removeListener(event, fn); | ||
} | ||
@@ -101,3 +101,3 @@ } | ||
fn.context = context; | ||
fn.__EE3_context = context; | ||
this._events[event].push(fn); | ||
@@ -117,3 +117,3 @@ | ||
EventEmitter.prototype.once = function once(event, fn, context) { | ||
fn.once = true; | ||
fn.__EE3_once = true; | ||
return this.on(event, fn, context); | ||
@@ -136,3 +136,3 @@ }; | ||
for (var i = 0, length = listeners.length; i < length; i++) { | ||
if (fn && listeners[i] !== fn && listeners[i].fn !== fn) { | ||
if (fn && listeners[i] !== fn) { | ||
events.push(listeners[i]); | ||
@@ -139,0 +139,0 @@ } |
{ | ||
"name": "eventemitter3", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface. This the source of the same EventEmitter that is used in Primus.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30030
0