Add shims for legacy electron APIs

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Max Brunsfeld
2016-08-24 13:05:46 -07:00
committed by Thomas Johansen
parent 874b555fde
commit e7444b1ebe
6 changed files with 30 additions and 0 deletions

7
src/electron-shims.js Normal file
View File

@@ -0,0 +1,7 @@
const electron = require('electron')
electron.ipcRenderer.sendChannel = function () {
const Grim = require('grim')
Grim.deprecate('Use `ipcRenderer.send` instead of `ipcRenderer.sendChannel`')
return this.send.apply(this, arguments)
}

View File

@@ -6,6 +6,7 @@ module.exports = ({blobStore}) ->
{getWindowLoadSettings} = require './window-load-settings-helpers'
{ipcRenderer} = require 'electron'
{resourcePath, isSpec, devMode, env} = getWindowLoadSettings()
require '../src/electron-shims'
updateProcessEnv(env)

View File

@@ -19,6 +19,7 @@ module.exports = ({blobStore}) ->
{getWindowLoadSettings} = require './window-load-settings-helpers'
AtomEnvironment = require '../src/atom-environment'
ApplicationDelegate = require '../src/application-delegate'
require '../src/electron-shims'
{testRunnerPath, legacyTestRunnerPath, headless, logFile, testPaths} = getWindowLoadSettings()