]> khamidou — GitHub mirrors - electron.git/commitdiff
Add setImmediate function in renderer.
authorCheng Zhao <zcbenz@gmail.com>
Sun, 15 Dec 2013 08:21:23 +0000 (16:21 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 15 Dec 2013 08:21:23 +0000 (16:21 +0800)
renderer/lib/init.coffee

index 01fbcbdc29e2fef12d6072a8efab31469b4bb50d..32d3d2ac61d5eb4cee699fc20a9ceb54df1a819b 100644 (file)
@@ -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:'