eventemitter2
Advanced tools
Comparing version 0.4.12 to 0.4.13
@@ -17,5 +17,5 @@ ;!function(exports, undefined) { | ||
if (conf) { | ||
this._conf = conf; | ||
conf.delimiter && (this.delimiter = conf.delimiter); | ||
@@ -113,3 +113,3 @@ conf.maxListeners && (this._events.maxListeners = conf.maxListeners); | ||
} | ||
xxTree = tree['**']; | ||
@@ -122,3 +122,3 @@ if(xxTree) { | ||
} | ||
// Build arrays of matching next branches and others. | ||
@@ -154,3 +154,3 @@ for(branch in xxTree) { | ||
type = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); | ||
// | ||
@@ -191,3 +191,3 @@ // Looks for two consecutive '**', if so, don't add the event at all. | ||
var m = defaultMaxListeners; | ||
if (typeof this._events.maxListeners !== 'undefined') { | ||
@@ -213,3 +213,3 @@ m = this._events.maxListeners; | ||
return true; | ||
}; | ||
} | ||
@@ -251,3 +251,3 @@ // By default EventEmitters will print a warning if more than | ||
fn.apply(this, arguments); | ||
}; | ||
} | ||
@@ -262,3 +262,3 @@ listener._origin = fn; | ||
EventEmitter.prototype.emit = function() { | ||
this._events || init.call(this); | ||
@@ -285,5 +285,5 @@ | ||
if (type === 'error') { | ||
if (!this._all && | ||
!this._events.error && | ||
if (!this._all && | ||
!this._events.error && | ||
!(this.wildcard && this.listenerTree.error)) { | ||
@@ -352,3 +352,3 @@ | ||
EventEmitter.prototype.on = function(type, listener) { | ||
if (typeof type === 'function') { | ||
@@ -389,3 +389,3 @@ this.onAny(type); | ||
var m = defaultMaxListeners; | ||
if (typeof this._events.maxListeners !== 'undefined') { | ||
@@ -461,7 +461,7 @@ m = this._events.maxListeners; | ||
if (position < 0) { | ||
return this; | ||
continue; | ||
} | ||
if(this.wildcard) { | ||
leaf._listeners.splice(position, 1) | ||
leaf._listeners.splice(position, 1); | ||
} | ||
@@ -480,2 +480,3 @@ else { | ||
} | ||
return this; | ||
} | ||
@@ -570,5 +571,5 @@ else if (handlers === listener || | ||
} else { | ||
exports.EventEmitter2 = EventEmitter; | ||
exports.EventEmitter2 = EventEmitter; | ||
} | ||
}(typeof process !== 'undefined' && typeof process.title !== 'undefined' && typeof exports !== 'undefined' ? exports : window); |
{ | ||
"name": "eventemitter2", | ||
"version": "0.4.12", | ||
"version": "0.4.13", | ||
"description": "A Node.js event emitter implementation with namespaces, wildcards, TTL and browser support.", | ||
@@ -22,5 +22,9 @@ "keywords": ["event", "events", "emitter", "eventemitter"], | ||
"scripts" : { | ||
"test" : "nodeunit test/simple/* && nodeunit test/wildcardEvents/*", | ||
"test" : "nodeunit test/simple/ && nodeunit test/wildcardEvents/", | ||
"benchmark" : "node test/perf/benchmark.js" | ||
} | ||
}, | ||
"files": [ | ||
"lib/eventemitter2.js", | ||
"index.js" | ||
] | ||
} |
# EventEmitter2 | ||
EventEmitter2 is a an implementation of the EventEmitter found in Node.js | ||
EventEmitter2 is an implementation of the EventEmitter found in Node.js | ||
@@ -5,0 +5,0 @@ ## Features |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
24586
4
469
1