Merge pull request #2866 from atom/no-expose-setimmediate
No more exposing setImmediate as local variable
This commit is contained in:
commit
889d7c1e02
7 changed files with 13 additions and 25 deletions
|
@ -1,4 +1,3 @@
|
|||
process = global.process
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
timers = require 'timers'
|
||||
|
@ -37,6 +36,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 +46,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
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
process = global.process
|
||||
ipc = require 'ipc'
|
||||
v8Util = process.atomBinding 'v8_util'
|
||||
CallbacksRegistry = require 'callbacks-registry'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
process = global.process
|
||||
events = require 'events'
|
||||
path = require 'path'
|
||||
url = require 'url'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
process = global.process
|
||||
ipc = require 'ipc'
|
||||
remote = require 'remote'
|
||||
|
||||
|
|
|
@ -304,10 +304,7 @@ describe 'browser-window module', ->
|
|||
done()
|
||||
w.loadUrl url
|
||||
|
||||
describe 'beginFrameSubscription method', ->
|
||||
# It is not very reliable on Travis CI.
|
||||
return if process.env.TRAVIS is 'true'
|
||||
|
||||
xdescribe 'beginFrameSubscription method', ->
|
||||
it 'subscribes frame updates', (done) ->
|
||||
w.loadUrl "file://#{fixtures}/api/blank.html"
|
||||
w.webContents.beginFrameSubscription (data) ->
|
||||
|
|
|
@ -86,7 +86,7 @@ describe '<webview> tag', ->
|
|||
|
||||
it 'preload script can still use "process" in required modules when nodeintegration is off', (done) ->
|
||||
webview.addEventListener 'console-message', (e) ->
|
||||
assert.equal e.message, 'object function object'
|
||||
assert.equal e.message, 'object undefined object'
|
||||
done()
|
||||
webview.setAttribute 'preload', "#{fixtures}/module/preload-node-off.js"
|
||||
webview.src = "file://#{fixtures}/api/blank.html"
|
||||
|
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
|||
Subproject commit aa9c7a2316ba7762f1d04d091585695be3e6be22
|
||||
Subproject commit fa54694af4350bf1720ff47e97a07c7c09325ee2
|
Loading…
Add table
Reference in a new issue