Use direct params instead of rest params

This commit is contained in:
Kevin Sawicki 2016-03-21 09:50:11 -07:00
parent 4f4dc2f4d8
commit 43746727aa
3 changed files with 9 additions and 11 deletions

View file

@ -43,9 +43,9 @@ var checkAppInitialized = function() {
module.exports = { module.exports = {
showOpenDialog: function(...args) { showOpenDialog: function(...args) {
var callback, options, prop, properties, ref1, value, window, wrappedCallback; var prop, properties, value, wrappedCallback;
checkAppInitialized(); checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2]; let [window, options, callback] = parseArgs.apply(null, args);
if (options == null) { if (options == null) {
options = { options = {
title: 'Open', title: 'Open',
@ -81,9 +81,9 @@ module.exports = {
}, },
showSaveDialog: function(...args) { showSaveDialog: function(...args) {
var callback, options, ref1, window, wrappedCallback; var wrappedCallback;
checkAppInitialized(); checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2]; let [window, options, callback] = parseArgs.apply(null, args);
if (options == null) { if (options == null) {
options = { options = {
title: 'Save' title: 'Save'
@ -105,9 +105,9 @@ module.exports = {
}, },
showMessageBox: function(...args) { showMessageBox: function(...args) {
var callback, flags, i, j, len, messageBoxType, options, ref1, ref2, ref3, text, window; var flags, i, j, len, messageBoxType, ref2, ref3, text;
checkAppInitialized(); checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2]; let [window, options, callback] = parseArgs.apply(null, args);
if (options == null) { if (options == null) {
options = { options = {
type: 'none' type: 'none'

View file

@ -51,11 +51,11 @@ var indexOfItemById = function(items, id) {
// Returns the index of where to insert the item according to |position|. // Returns the index of where to insert the item according to |position|.
var indexToInsertByPosition = function(items, position) { var indexToInsertByPosition = function(items, position) {
var id, insertIndex, query, ref1; var insertIndex;
if (!position) { if (!position) {
return items.length; return items.length;
} }
ref1 = position.split('='), query = ref1[0], id = ref1[1]; const [query, id] = position.split('=');
insertIndex = indexOfItemById(items, id); insertIndex = indexOfItemById(items, id);
if (insertIndex === -1 && query !== 'endof') { if (insertIndex === -1 && query !== 'endof') {
console.warn("Item with id '" + id + "' is not found"); console.warn("Item with id '" + id + "' is not found");

View file

@ -82,9 +82,7 @@ var createGuest = function(embedder, url, frameName, options) {
}; };
// Routed window.open messages. // Routed window.open messages.
ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', function(event, ...args) { ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', function(event, url, frameName, options) {
var frameName, options, url;
url = args[0], frameName = args[1], options = args[2];
options = mergeBrowserWindowOptions(event.sender, options); options = mergeBrowserWindowOptions(event.sender, options);
event.sender.emit('new-window', event, url, frameName, 'new-window', options); event.sender.emit('new-window', event, url, frameName, 'new-window', options);
if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) { if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) {