Inline var

This commit is contained in:
Jessica Lord 2016-01-14 15:44:33 -08:00
parent 5412ecdcc1
commit ae2893ceaa

View file

@ -9,14 +9,6 @@ const app = bindings.app;
var slice = [].slice; var slice = [].slice;
var appPath;
var fn;
var i;
var len;
var name;
var ref1;
var wrapDownloadItem;
app.__proto__ = EventEmitter.prototype; app.__proto__ = EventEmitter.prototype;
app.setApplicationMenu = function(menu) { app.setApplicationMenu = function(menu) {
@ -49,7 +41,7 @@ if (process.platform === 'darwin') {
}; };
} }
appPath = null; var appPath = null;
app.setAppPath = function(path) { app.setAppPath = function(path) {
return appPath = path; return appPath = path;
@ -60,16 +52,17 @@ app.getAppPath = function() {
}; };
// Routes the events to webContents. // Routes the events to webContents.
ref1 = ['login', 'certificate-error', 'select-client-certificate']; var ref1 = ['login', 'certificate-error', 'select-client-certificate'];
fn = function(name) { var fn = function(name) {
return app.on(name, function() { return app.on(name, function() {
var args, event, webContents; var args, event, webContents;
event = arguments[0], webContents = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; event = arguments[0], webContents = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
return webContents.emit.apply(webContents, [name, event].concat(slice.call(args))); return webContents.emit.apply(webContents, [name, event].concat(slice.call(args)));
}); });
}; };
var i, len;
for (i = 0, len = ref1.length; i < len; i++) { for (i = 0, len = ref1.length; i < len; i++) {
name = ref1[i]; var name = ref1[i];
fn(name); fn(name);
} }
@ -112,7 +105,7 @@ deprecate.event(app, 'activate-with-no-open-windows', 'activate', function(event
deprecate.event(app, 'select-certificate', 'select-client-certificate'); deprecate.event(app, 'select-certificate', 'select-client-certificate');
// Wrappers for native classes. // Wrappers for native classes.
wrapDownloadItem = function(downloadItem) { var wrapDownloadItem = function(downloadItem) {
// downloadItem is an EventEmitter. // downloadItem is an EventEmitter.
downloadItem.__proto__ = EventEmitter.prototype; downloadItem.__proto__ = EventEmitter.prototype;