Use for/of and remove loop variables
This commit is contained in:
parent
6eab14359c
commit
0e1c2b0fcb
3 changed files with 13 additions and 20 deletions
|
@ -402,18 +402,17 @@ var registerWebViewElement = function () {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0, len = methods.length; i < len; i++) {
|
||||
const method = methods[i]
|
||||
for (const method of methods) {
|
||||
proto[method] = createBlockHandler(method)
|
||||
}
|
||||
|
||||
const createNonBlockHandler = function (m) {
|
||||
return function (...args) {
|
||||
const internal = v8Util.getHiddenValue(this, 'internal')
|
||||
ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_BROWSER_ASYNC_CALL_TO_GUEST_VIEW', null, internal.guestInstanceId, m].concat(args))
|
||||
}
|
||||
}
|
||||
for (let j = 0, len1 = nonblockMethods.length; j < len1; j++) {
|
||||
const method = nonblockMethods[j]
|
||||
for (const method of nonblockMethods) {
|
||||
proto[method] = createNonBlockHandler(method)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue