avoid using eslint comment exceptions
This commit is contained in:
parent
1a18151eff
commit
b5afad9da7
5 changed files with 10 additions and 13 deletions
|
@ -128,14 +128,14 @@ let wrapWebContents = function (webContents) {
|
|||
return ipcMain.emit.apply(ipcMain, [channel, event].concat(args))
|
||||
})
|
||||
webContents.on('ipc-message-sync', function (event, [channel, ...args]) {
|
||||
/* eslint-disable */
|
||||
// standard complains: Getter is not present
|
||||
Object.defineProperty(event, 'returnValue', {
|
||||
set: function (value) {
|
||||
return event.sendReply(JSON.stringify(value))
|
||||
},
|
||||
get: function () {
|
||||
return undefined
|
||||
}
|
||||
})
|
||||
/* eslint-enable */
|
||||
return ipcMain.emit.apply(ipcMain, [channel, event].concat(args))
|
||||
})
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ ipcMain.on('ATOM_BROWSER_CONSTRUCTOR', function (event, id, args) {
|
|||
|
||||
// Call new with array of arguments.
|
||||
// http://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible
|
||||
let obj = new (Function.prototype.bind.apply(constructor, [null].concat(args))) // eslint-disable-line
|
||||
let obj = new (Function.prototype.bind.apply(constructor, [null].concat(args)))
|
||||
event.returnValue = valueToMeta(event.sender, obj)
|
||||
} catch (error) {
|
||||
event.returnValue = exceptionToMeta(error)
|
||||
|
@ -304,7 +304,7 @@ ipcMain.on('ATOM_BROWSER_MEMBER_CONSTRUCTOR', function (event, id, method, args)
|
|||
let constructor = objectsRegistry.get(id)[method]
|
||||
|
||||
// Call new with array of arguments.
|
||||
let obj = new (Function.prototype.bind.apply(constructor, [null].concat(args))) // eslint-disable-line
|
||||
let obj = new (Function.prototype.bind.apply(constructor, [null].concat(args)))
|
||||
event.returnValue = valueToMeta(event.sender, obj)
|
||||
} catch (error) {
|
||||
event.returnValue = exceptionToMeta(error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue