From 0b780def24f61fcf5c85d05c7fdc15ed5e00c88a Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Fri, 6 Mar 2015 17:56:26 +0530 Subject: [PATCH] avoid overriding type value of showMessageBox --- .gitignore | 1 + atom/browser/api/lib/dialog.coffee | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1907e66..4410f30 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ node_modules/ *.xcodeproj *.swp *.pyc +npm-debug.log diff --git a/atom/browser/api/lib/dialog.coffee b/atom/browser/api/lib/dialog.coffee index ddb5a20..95ecf99 100644 --- a/atom/browser/api/lib/dialog.coffee +++ b/atom/browser/api/lib/dialog.coffee @@ -83,8 +83,8 @@ module.exports = options ?= type: 'none' options.type ?= 'none' - options.type = messageBoxTypes.indexOf options.type - throw new TypeError('Invalid message box type') unless options.type > -1 + messageBoxType = messageBoxTypes.indexOf options.type + throw new TypeError('Invalid message box type') unless messageBoxType > -1 throw new TypeError('Buttons need to be array') unless Array.isArray options.buttons @@ -93,7 +93,7 @@ module.exports = options.detail ?= '' options.icon ?= null - binding.showMessageBox options.type, + binding.showMessageBox messageBoxType, options.buttons, [options.title, options.message, options.detail], options.icon, -- 2.7.4