fix standard issues

This commit is contained in:
Shelley Vohr 2017-10-25 09:56:02 -04:00
parent f129622446
commit c0f2a7b44a
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -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