Use spread operator
This commit is contained in:
parent
e4d6aa30a1
commit
0485069c7b
2 changed files with 3 additions and 3 deletions
|
@ -68,7 +68,7 @@ module.exports = {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on(`ELECTRON_GUEST_VIEW_INTERNAL_DISPATCH_EVENT-${viewInstanceId}`, function (event, eventName, ...args) {
|
ipcRenderer.on(`ELECTRON_GUEST_VIEW_INTERNAL_DISPATCH_EVENT-${viewInstanceId}`, function (event, eventName, ...args) {
|
||||||
dispatchEvent.apply(null, [webView, eventName, eventName].concat(args))
|
dispatchEvent(webView, eventName, eventName, ...args)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on(`ELECTRON_GUEST_VIEW_INTERNAL_IPC_MESSAGE-${viewInstanceId}`, function (event, channel, ...args) {
|
ipcRenderer.on(`ELECTRON_GUEST_VIEW_INTERNAL_IPC_MESSAGE-${viewInstanceId}`, function (event, channel, ...args) {
|
||||||
|
|
|
@ -396,7 +396,7 @@ var registerWebViewElement = function () {
|
||||||
return function (...args) {
|
return function (...args) {
|
||||||
const internal = v8Util.getHiddenValue(this, 'internal')
|
const internal = v8Util.getHiddenValue(this, 'internal')
|
||||||
if (internal.webContents) {
|
if (internal.webContents) {
|
||||||
return internal.webContents[m].apply(internal.webContents, args)
|
return internal.webContents[m](...args)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Cannot call ${m} because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emitted before this method can be called.`)
|
throw new Error(`Cannot call ${m} because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emitted before this method can be called.`)
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ var registerWebViewElement = function () {
|
||||||
const createNonBlockHandler = function (m) {
|
const createNonBlockHandler = function (m) {
|
||||||
return function (...args) {
|
return function (...args) {
|
||||||
const internal = v8Util.getHiddenValue(this, 'internal')
|
const internal = v8Util.getHiddenValue(this, 'internal')
|
||||||
ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_BROWSER_ASYNC_CALL_TO_GUEST_VIEW', null, internal.guestInstanceId, m].concat(args))
|
ipcRenderer.send('ELECTRON_BROWSER_ASYNC_CALL_TO_GUEST_VIEW', null, internal.guestInstanceId, m, ...args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const method of nonblockMethods) {
|
for (const method of nonblockMethods) {
|
||||||
|
|
Loading…
Reference in a new issue