fix Emitter.call(this) usage

This commit is contained in:
TJ Holowaychuk
2012-09-07 14:32:52 -07:00
parent c4df699d38
commit 2c6aa090f4
2 changed files with 17 additions and 1 deletions

View File

@@ -1,6 +1,22 @@
var Emitter = require('..');
function Custom() {
Emitter.call(this)
}
Custom.prototype.__proto__ = Emitter.prototype;
describe('Custom', function(){
describe('with Emitter.call(this)', function(){
it('should work', function(done){
var emitter = new Custom;
emitter.on('foo', done);
emitter.emit('foo');
})
})
})
describe('Emitter', function(){
describe('.on(event, fn)', function(){
it('should add listeners', function(){