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

Commit 2203db2f by Sascha Depold

Merge branch 'setimmediate' of https://github.com/durango/sequelize into durango-setimmediate

2 parents 78645c10 202c33fb
Showing with 5 additions and 5 deletions
...@@ -2,13 +2,13 @@ var util = require("util") ...@@ -2,13 +2,13 @@ var util = require("util")
, EventEmitter = require("events").EventEmitter , EventEmitter = require("events").EventEmitter
, Promise = require("promise") , Promise = require("promise")
, proxyEventKeys = ['success', 'error', 'sql'] , proxyEventKeys = ['success', 'error', 'sql']
, tick = (typeof setImmediate !== "undefined" ? setImmediate : process.nextTick)
var bindToProcess = function(fct) { var bindToProcess = function(fct) {
if (fct) { if (fct) {
if(process.domain) { if (process.domain) {
return process.domain.bind(fct); return process.domain.bind(fct);
} }
} }
return fct; return fct;
...@@ -21,7 +21,7 @@ module.exports = (function() { ...@@ -21,7 +21,7 @@ module.exports = (function() {
util.inherits(CustomEventEmitter, EventEmitter) util.inherits(CustomEventEmitter, EventEmitter)
CustomEventEmitter.prototype.run = function() { CustomEventEmitter.prototype.run = function() {
process.nextTick(function() { tick(function() {
if (this.fct) { if (this.fct) {
this.fct.call(this, this) this.fct.call(this, this)
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!