fix standard issues
This commit is contained in:
parent
f129622446
commit
c0f2a7b44a
1 changed files with 4 additions and 8 deletions
|
@ -21,7 +21,7 @@ const ipcs = {
|
|||
'b_func_call': 'ELECTRON_BROWSER_FUNCTION_CALL',
|
||||
'rend_call': 'ELECTRON_RENDERER_CALLBACK',
|
||||
'rend_rel_call': 'ELECTRON_RENDERER_RELEASE_CALLBACK',
|
||||
'b_con_rel': 'ELECTRON_BROWSER_CONTEXT_RELEASE'
|
||||
'b_con_rel': 'ELECTRON_BROWSER_CONTEXT_RELEASE',
|
||||
'b_req': 'ELECTRON_BROWSER_REQUIRE',
|
||||
'b_get_built': 'ELECTRON_BROWSER_GET_BUILTIN',
|
||||
'b_curr_win': 'ELECTRON_BROWSER_CURRENT_WINDOW',
|
||||
|
@ -231,7 +231,7 @@ function metaToValue (meta) {
|
|||
return members.map((member) => metaToValue(member))
|
||||
},
|
||||
'buffer': () => Buffer.from(meta.value),
|
||||
'promise': () => resolvePromise({then: metaToValue(meta.then)})
|
||||
'promise': () => resolvePromise({then: metaToValue(meta.then)}),
|
||||
'error': () => metaToPlainObject(meta),
|
||||
'date': () => new Date(meta.value),
|
||||
'exception': () => new Error(`${meta.message}\n${meta.stack}`)
|
||||
|
@ -247,13 +247,9 @@ function metaToValue (meta) {
|
|||
if (meta.type === 'function') {
|
||||
let remoteFunction = function (...args) {
|
||||
if (this && this.constructor === remoteFunction) {
|
||||
return metaToValue(ipcRenderer.sendSync(
|
||||
ipcs['b_con'], meta.id, wrapArgs(args)
|
||||
)
|
||||
return metaToValue(ipcRenderer.sendSync(ipcs['b_con'], meta.id, wrapArgs(args)))
|
||||
} else {
|
||||
return metaToValue(ipcRenderer.sendSync(
|
||||
ipcs['b_func_call'], meta.id, wrapArgs(args)
|
||||
)
|
||||
return metaToValue(ipcRenderer.sendSync(ipcs['b_func_call'], meta.id, wrapArgs(args)))
|
||||
}
|
||||
}
|
||||
ret = remoteFunction
|
||||
|
|
Loading…
Reference in a new issue