Fix exception in alert for inavlid parameter

This commit is contained in:
Cheng Zhao 2016-06-14 15:22:01 +09:00
parent b0f3443d72
commit 18a38dbfc1

View file

@ -154,20 +154,11 @@ window.open = function (url, frameName, features) {
}
// Use the dialog API to implement alert().
window.alert = function (message, title) {
var buttons
if (arguments.length === 0) {
message = ''
}
if (title == null) {
title = ''
}
buttons = ['OK']
message = String(message)
window.alert = function (message = '', title = '') {
remote.dialog.showMessageBox(remote.getCurrentWindow(), {
message: message,
title: title,
buttons: buttons
message: String(message),
title: String(title),
buttons: ['OK']
})
}