Remove returns from event listeners

This commit is contained in:
Kevin Sawicki 2016-05-19 15:28:08 -07:00
parent a2b6731bf2
commit cc7395eea8
15 changed files with 34 additions and 36 deletions

View file

@ -59,8 +59,7 @@ deprecate.property = function (object, property, method) {
// Deprecate an event.
deprecate.event = function (emitter, oldName, newName, fn) {
var warned
warned = false
var warned = false
return emitter.on(newName, function (...args) {
// there is listeners for old API.
if (this.listenerCount(oldName) > 0) {
@ -69,9 +68,9 @@ deprecate.event = function (emitter, oldName, newName, fn) {
deprecate.warn("'" + oldName + "' event", "'" + newName + "' event")
}
if (fn != null) {
return fn.apply(this, arguments)
fn.apply(this, arguments)
} else {
return this.emit.apply(this, [oldName].concat(args))
this.emit.apply(this, [oldName].concat(args))
}
}
})