Add setImmediate function in renderer.

This commit is contained in:
Cheng Zhao 2013-12-15 16:21:23 +08:00
parent cc5db4dab9
commit 7ba03ce23d

View file

@ -1,4 +1,5 @@
path = require 'path' path = require 'path'
timers = require 'timers'
Module = require 'module' Module = require 'module'
# Expose information of current process. # Expose information of current process.
@ -21,6 +22,10 @@ globalPaths.push path.join(process.resourcesPath, 'app')
# Expose global variables. # Expose global variables.
global.require = require global.require = require
global.module = module 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. # Set the __filename to the path of html file if it's file:// protocol.
if window.location.protocol is 'file:' if window.location.protocol is 'file:'