Use const

This commit is contained in:
Jessica Lord 2016-01-14 13:16:42 -08:00
parent f31289c735
commit 9103253f62
10 changed files with 55 additions and 72 deletions

View file

@ -1,27 +1,25 @@
var BrowserWindow, api, app, binding, checkAppInitialized, fileDialogProperties, j, len, messageBoxOptions, messageBoxTypes, parseArgs, ref, ref1, v8Util,
slice = [].slice,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
const app = require('electron').app;
const BrowserWindow = require('electron').BrowserWindow;
const binding = process.atomBinding('dialog');
const v8Util = process.atomBinding('v8_util');
ref = require('electron'), app = ref.app, BrowserWindow = ref.BrowserWindow;
var slice = [].slice;
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
binding = process.atomBinding('dialog');
v8Util = process.atomBinding('v8_util');
fileDialogProperties = {
var fileDialogProperties = {
openFile: 1 << 0,
openDirectory: 1 << 1,
multiSelections: 1 << 2,
createDirectory: 1 << 3
};
messageBoxTypes = ['none', 'info', 'warning', 'error', 'question'];
var messageBoxTypes = ['none', 'info', 'warning', 'error', 'question'];
messageBoxOptions = {
var messageBoxOptions = {
noLink: 1 << 0
};
parseArgs = function(window, options, callback) {
var parseArgs = function(window, options, callback) {
if (!(window === null || (window != null ? window.constructor : void 0) === BrowserWindow)) {
// Shift.
callback = options;
@ -36,7 +34,7 @@ parseArgs = function(window, options, callback) {
return [window, options, callback];
};
checkAppInitialized = function() {
var checkAppInitialized = function() {
if (!app.isReady()) {
throw new Error('dialog module can only be used after app is ready');
}
@ -164,8 +162,9 @@ module.exports = {
};
// Mark standard asynchronous functions.
ref1 = ['showMessageBox', 'showOpenDialog', 'showSaveDialog'];
var ref1 = ['showMessageBox', 'showOpenDialog', 'showSaveDialog'];
var j, len
for (j = 0, len = ref1.length; j < len; j++) {
api = ref1[j];
var api = ref1[j];
v8Util.setHiddenValue(module.exports[api], 'asynchronous', true);
}