diff --git a/spec/static/main.js b/spec/static/main.js index ab16e19c9e3..eaa5dd0f305 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -257,7 +257,9 @@ ipcMain.on('try-emit-web-contents-event', (event, id, eventName) => { const listenerCountBefore = contents.listenerCount(eventName) try { - console.warn = (message) => warningMessage = message + console.warn = (message) => { + warningMessage = message + } contents.emit(eventName, {sender: contents}) } finally { console.warn = consoleWarn