eventemitter2
Advanced tools
Comparing version 0.4.9 to 0.4.10
@@ -15,2 +15,3 @@ ;!function(exports, undefined) { | ||
conf.delimiter && (this.delimiter = conf.delimiter); | ||
conf.maxListeners && (this._events.maxListeners = conf.maxListeners); | ||
conf.wildcard && (this.wildcard = conf.wildcard); | ||
@@ -17,0 +18,0 @@ if (this.wildcard) { |
{ | ||
"name": "eventemitter2", | ||
"version": "0.4.9", | ||
"version": "0.4.10", | ||
"description": "A Node.js event emitter implementation with namespaces, wildcards, TTL and browser support.", | ||
@@ -12,2 +12,3 @@ "keywords": ["event", "events", "emitter", "eventemitter"], | ||
"contributors": [ | ||
"Eric Elliott", | ||
"Charlie Robbins <charlie@nodejitsu.com> http://twitter.com/indexzero", | ||
@@ -14,0 +15,0 @@ "Jameson Lee <jameson@nodejitsu.com> http://twitter.com/Jamesonjlee", |
@@ -93,3 +93,3 @@ # EventEmitter2 | ||
server.on('data', function(value) { | ||
console.log('This event will be listened to exactly four times.'); | ||
console.log('The event was raised!'); | ||
}); | ||
@@ -104,3 +104,3 @@ ``` | ||
server.onAny(function(value) { | ||
console.log('This event will be listened to exactly four times.'); | ||
console.log('All events trigger this.'); | ||
}); | ||
@@ -115,3 +115,3 @@ ``` | ||
server.offAny(function(value) { | ||
console.log('This event will be listened to exactly four times.'); | ||
console.log('The event was raised!'); | ||
}); | ||
@@ -136,3 +136,3 @@ ``` | ||
server.many('get', 4, function (value) { | ||
console.log('Ah, we have our first value!'); | ||
console.log('This event will be listened to exactly four times.'); | ||
}); | ||
@@ -178,3 +178,3 @@ ``` | ||
#### emitter.listenersAny(event) | ||
#### emitter.listenersAny() | ||
@@ -181,0 +181,0 @@ Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. |
@@ -77,2 +77,3 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
global.DataView!==undefined?DataView:null, | ||
global.Uint8ClampedArray!==undefined?Uint8ClampedArray:null, | ||
AssertionError, | ||
@@ -124,2 +125,1 @@ global, | ||
}; | ||
@@ -8,12 +8,10 @@ var simpleEvents = require('nodeunit').testCase; | ||
setUp: function (callback) { | ||
var EventEmitter2; | ||
if(typeof require !== 'undefined') { | ||
EventEmitter2 = require(file).EventEmitter2; | ||
this.EventEmitter2 = require(file).EventEmitter2; | ||
} | ||
else { | ||
EventEmitter2 = window.EventEmitter2; | ||
this.EventEmitter2 = window.EventEmitter2; | ||
} | ||
this.emitter = new EventEmitter2({ verbose: true }); | ||
this.emitter = new this.EventEmitter2({ verbose: true }); | ||
callback(); | ||
@@ -140,5 +138,4 @@ }, | ||
var emitter = this.emitter; | ||
var type = 'somelistenerbar'; | ||
var f = function () { | ||
test.ok(true, 'the event was fired') | ||
test.ok(true, 'the event was fired'); | ||
}; | ||
@@ -162,5 +159,4 @@ | ||
var emitter = this.emitter; | ||
var type = 'somelistenerbar'; | ||
var f = function () { | ||
test.ok(true, 'the event was fired') | ||
test.ok(true, 'the event was fired'); | ||
}; | ||
@@ -179,3 +175,2 @@ emitter.onAny(f); | ||
var emitter = this.emitter; | ||
var type = 'somelistenerbar'; | ||
@@ -195,3 +190,2 @@ var f = function () { | ||
} | ||
}); |
@@ -8,12 +8,11 @@ var simpleEvents= require('nodeunit').testCase; | ||
setUp: function (callback) { | ||
var EventEmitter2; | ||
if(typeof require !== 'undefined') { | ||
EventEmitter2 = require(file).EventEmitter2; | ||
this.EventEmitter2 = require(file).EventEmitter2; | ||
} | ||
else { | ||
EventEmitter2 = window.EventEmitter2; | ||
this.EventEmitter2 = window.EventEmitter2; | ||
} | ||
this.emitter = new EventEmitter2; | ||
this.emitter = new this.EventEmitter2; | ||
callback(); | ||
@@ -133,3 +132,14 @@ }, | ||
}, | ||
'maxListeners parameter. Passing maxListeners as a parameter should override default.' : function (test) { | ||
var emitter = new this.EventEmitter2({ | ||
maxListeners: 2 | ||
}); | ||
console.log(emitter, test.equal, test.ok); | ||
emitter.on('a', function () {}); | ||
emitter.on('a', function () {}); | ||
emitter.on('a', function () {}); | ||
test.ok(emitter._events.a.warned, | ||
'.on() should warn when maxListeners is exceeded.'); | ||
test.done(); | ||
} | ||
}); |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
99617
2686
1