Skip to content

Commit

Permalink
fix: no-arg console.log is undefined (#22172)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <codebytere@github.com>
  • Loading branch information
trop[bot] and codebytere committed Feb 14, 2020
1 parent 89607e6 commit ceb3b0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/browser/init.ts
Expand Up @@ -18,8 +18,10 @@ require('@electron/internal/common/init')
if (process.platform === 'win32') {
// Redirect node's console to use our own implementations, since node can not
// handle console output when running as GUI program.
const consoleLog = (format: any, ...args: any[]) => {
return process.log(util.format(format, ...args) + '\n')
const consoleLog = (...args: any[]) => {
// @ts-ignore this typing is incorrect; 'format' is an optional parameter
// See https://nodejs.org/api/util.html#util_util_format_format_args
return process.log(util.format(...args) + '\n')
}
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
if (Buffer.isBuffer(chunk)) {
Expand Down

0 comments on commit ceb3b0c

Please sign in to comment.