From eccb5e759074277bfa2670abafe5731f40bd38b5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 14:29:21 +0800 Subject: [PATCH] Don't make setImmediate a local variable It makes more troubles than benefits, and somehow it is slowing message loop down. --- atom/common/lib/init.coffee | 9 ++------- vendor/node | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/atom/common/lib/init.coffee b/atom/common/lib/init.coffee index 4bc3e36986c0..5db6b7dcbbe0 100644 --- a/atom/common/lib/init.coffee +++ b/atom/common/lib/init.coffee @@ -37,6 +37,8 @@ wrapWithActivateUvLoop = (func) -> process.activateUvLoop() func.apply this, arguments process.nextTick = wrapWithActivateUvLoop process.nextTick +global.setImmediate = wrapWithActivateUvLoop timers.setImmediate +global.clearImmediate = timers.clearImmediate if process.type is 'browser' # setTimeout needs to update the polling timeout of the event loop, when @@ -45,10 +47,3 @@ if process.type is 'browser' # recalculate the timeout in browser process. global.setTimeout = wrapWithActivateUvLoop timers.setTimeout global.setInterval = wrapWithActivateUvLoop timers.setInterval - global.setImmediate = wrapWithActivateUvLoop timers.setImmediate - global.clearImmediate = wrapWithActivateUvLoop timers.clearImmediate -else - # There are no setImmediate under renderer process by default, so we need to - # manually setup them here. - global.setImmediate = setImmediate - global.clearImmediate = clearImmediate diff --git a/vendor/node b/vendor/node index aa9c7a2316ba..fa54694af435 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit aa9c7a2316ba7762f1d04d091585695be3e6be22 +Subproject commit fa54694af4350bf1720ff47e97a07c7c09325ee2