Use rest parameters

This commit is contained in:
Kevin Sawicki 2016-03-18 11:51:02 -07:00
parent e05804848f
commit 8889c29866
14 changed files with 88 additions and 143 deletions

View file

@ -1,9 +1,10 @@
'use strict';
const app = require('electron').app;
const BrowserWindow = require('electron').BrowserWindow;
const binding = process.atomBinding('dialog');
const v8Util = process.atomBinding('v8_util');
var slice = [].slice;
var includes = [].includes;
var fileDialogProperties = {
@ -41,9 +42,8 @@ var checkAppInitialized = function() {
};
module.exports = {
showOpenDialog: function() {
var args, callback, options, prop, properties, ref1, value, window, wrappedCallback;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
showOpenDialog: function(...args) {
var callback, options, prop, properties, ref1, value, window, wrappedCallback;
checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2];
if (options == null) {
@ -79,9 +79,9 @@ module.exports = {
} : null;
return binding.showOpenDialog(String(options.title), String(options.defaultPath), options.filters, properties, window, wrappedCallback);
},
showSaveDialog: function() {
var args, callback, options, ref1, window, wrappedCallback;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
showSaveDialog: function(...args) {
var callback, options, ref1, window, wrappedCallback;
checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2];
if (options == null) {
@ -103,9 +103,9 @@ module.exports = {
} : null;
return binding.showSaveDialog(String(options.title), String(options.defaultPath), options.filters, window, wrappedCallback);
},
showMessageBox: function() {
var args, callback, flags, i, j, len, messageBoxType, options, ref1, ref2, ref3, text, window;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
showMessageBox: function(...args) {
var callback, flags, i, j, len, messageBoxType, options, ref1, ref2, ref3, text, window;
checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2];
if (options == null) {
@ -154,9 +154,8 @@ module.exports = {
flags = options.noLink ? messageBoxOptions.noLink : 0;
return binding.showMessageBox(messageBoxType, options.buttons, options.defaultId, options.cancelId, flags, options.title, options.message, options.detail, options.icon, window, callback);
},
showErrorBox: function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
showErrorBox: function(...args) {
return binding.showErrorBox.apply(binding, args);
}
};