From: Cheng Zhao Date: Sun, 15 Dec 2013 08:21:23 +0000 (+0800) Subject: Add setImmediate function in renderer. X-Git-Tag: v0.8.0~4^2~37 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=7ba03ce23dda588b9b5fa0735e5f437ea467d146;p=electron.git Add setImmediate function in renderer. --- diff --git a/renderer/lib/init.coffee b/renderer/lib/init.coffee index 01fbcbdc..32d3d2ac 100644 --- a/renderer/lib/init.coffee +++ b/renderer/lib/init.coffee @@ -1,4 +1,5 @@ -path = require 'path' +path = require 'path' +timers = require 'timers' Module = require 'module' # Expose information of current process. @@ -21,6 +22,10 @@ globalPaths.push path.join(process.resourcesPath, 'app') # Expose global variables. global.require = require global.module = module +global.setImmediate = -> + process.activateUvLoop() + timers.setImmediate.apply this, arguments +global.clearImmediate = timers.clearImmediate # Set the __filename to the path of html file if it's file:// protocol. if window.location.protocol is 'file:'