From 9f6541228d0dfcee3d5ae0da8322ee87dcc8c24f Mon Sep 17 00:00:00 2001 From: OctoHuman Date: Sun, 20 Mar 2016 02:09:30 -0500 Subject: [PATCH 1/2] Fix alert() --- lib/renderer/override.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/renderer/override.js b/lib/renderer/override.js index 69295d1632..3daea936f4 100644 --- a/lib/renderer/override.js +++ b/lib/renderer/override.js @@ -161,11 +161,14 @@ window.open = function(url, frameName, features) { // Use the dialog API to implement alert(). window.alert = function(message, title) { var buttons; + if (message === undefined) { + message = ''; + } if (title == null) { title = ''; } buttons = ['OK']; - message = message.toString(); + message = String(message); remote.dialog.showMessageBox(remote.getCurrentWindow(), { message: message, title: title, From 116d61185a887b50c2a214c0736e07dd6b806868 Mon Sep 17 00:00:00 2001 From: OctoHuman Date: Sun, 20 Mar 2016 03:40:12 -0500 Subject: [PATCH 2/2] Refix alert() --- lib/renderer/override.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/renderer/override.js b/lib/renderer/override.js index 3daea936f4..63c7794ea5 100644 --- a/lib/renderer/override.js +++ b/lib/renderer/override.js @@ -161,7 +161,7 @@ window.open = function(url, frameName, features) { // Use the dialog API to implement alert(). window.alert = function(message, title) { var buttons; - if (message === undefined) { + if (arguments.length == 0) { message = ''; } if (title == null) {