不要怂,就是干,撸起袖子干!

Commit f54644e6 by Mick Hansen

Why use self when we have bind?

1 parent fe77d52d
Showing with 2 additions and 5 deletions
......@@ -4,16 +4,13 @@ var util = require("util")
module.exports = (function() {
var CustomEventEmitter = function(fct) {
this.fct = fct
var self = this
}
util.inherits(CustomEventEmitter, EventEmitter)
CustomEventEmitter.prototype.run = function() {
var self = this
process.nextTick(function() {
if (self.fct) {
self.fct.call(self, self)
if (this.fct) {
this.fct.call(this, this)
}
}.bind(this))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!