Use const
This commit is contained in:
parent
1779701445
commit
ab8908a4af
7 changed files with 29 additions and 49 deletions
|
@ -1,12 +1,7 @@
|
|||
var Module, fs, path, timers, wrapWithActivateUvLoop;
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
path = require('path');
|
||||
|
||||
timers = require('timers');
|
||||
|
||||
Module = require('module');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const timers = require('timers');
|
||||
const Module = require('module');
|
||||
|
||||
process.atomBinding = function(name) {
|
||||
var e, error;
|
||||
|
@ -32,7 +27,7 @@ if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
|
|||
// which would delay the callbacks for arbitrary long time. So we should
|
||||
// initiatively activate the uv loop once setImmediate and process.nextTick is
|
||||
// called.
|
||||
wrapWithActivateUvLoop = function(func) {
|
||||
var wrapWithActivateUvLoop = function(func) {
|
||||
return function() {
|
||||
process.activateUvLoop();
|
||||
return func.apply(this, arguments);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
var Module, path;
|
||||
|
||||
path = require('path');
|
||||
|
||||
Module = require('module');
|
||||
const path = require('path');
|
||||
const Module = require('module');
|
||||
|
||||
// Clear Node's global search paths.
|
||||
Module.globalPaths.length = 0;
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
var getNextId, ipcRenderer, isValid, nativeImage, nextId, ref,
|
||||
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 ipcRenderer = require('electron').ipcRenderer;
|
||||
const nativeImage = require('electron').ref.nativeImage;
|
||||
|
||||
ref = require('electron'), ipcRenderer = ref.ipcRenderer, nativeImage = ref.nativeImage;
|
||||
var nextId = 0;
|
||||
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; };
|
||||
|
||||
nextId = 0;
|
||||
|
||||
getNextId = function() {
|
||||
var getNextId = function() {
|
||||
return ++nextId;
|
||||
};
|
||||
|
||||
// |options.type| can not be empty and has to include 'window' or 'screen'.
|
||||
isValid = function(options) {
|
||||
var isValid = function(options) {
|
||||
return ((options != null ? options.types : void 0) != null) && Array.isArray(options.types);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
var common;
|
||||
|
||||
common = require('../../../../common/api/lib/exports/electron');
|
||||
const common = require('../../../../common/api/lib/exports/electron');
|
||||
|
||||
// Import common modules.
|
||||
common.defineProperties(exports);
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
var EventEmitter, binding, ipcRenderer, v8Util,
|
||||
slice = [].slice;
|
||||
const EventEmitter = require('events').EventEmitter;
|
||||
const binding = process.atomBinding('ipc');
|
||||
const v8Util = process.atomBinding('v8_util');
|
||||
|
||||
EventEmitter = require('events').EventEmitter;
|
||||
|
||||
binding = process.atomBinding('ipc');
|
||||
|
||||
v8Util = process.atomBinding('v8_util');
|
||||
var slice = [].slice;
|
||||
|
||||
// Created by init.coffee.
|
||||
ipcRenderer = v8Util.getHiddenValue(global, 'ipc');
|
||||
const ipcRenderer = v8Util.getHiddenValue(global, 'ipc');
|
||||
|
||||
ipcRenderer.send = function() {
|
||||
var args;
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
var chrome, url;
|
||||
|
||||
url = require('url');
|
||||
|
||||
chrome = window.chrome = window.chrome || {};
|
||||
const url = require('url');
|
||||
const chrome = window.chrome = window.chrome || {};
|
||||
|
||||
chrome.extension = {
|
||||
getURL: function(path) {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
var convertToMenuTemplate, createFileSelectorElement, createMenu, pathToHtml5FileObject, showFileChooserDialog;
|
||||
|
||||
window.onload = function() {
|
||||
// Use menu API to show context menu.
|
||||
InspectorFrontendHost.showContextMenuAtPoint = createMenu;
|
||||
|
@ -8,7 +6,7 @@ window.onload = function() {
|
|||
return WebInspector.createFileSelectorElement = createFileSelectorElement;
|
||||
};
|
||||
|
||||
convertToMenuTemplate = function(items) {
|
||||
var convertToMenuTemplate = function(items) {
|
||||
var fn, i, item, len, template;
|
||||
template = [];
|
||||
fn = function(item) {
|
||||
|
@ -45,11 +43,10 @@ convertToMenuTemplate = function(items) {
|
|||
return template;
|
||||
};
|
||||
|
||||
createMenu = function(x, y, items, document) {
|
||||
var Menu, menu, remote;
|
||||
remote = require('electron').remote;
|
||||
Menu = remote.Menu;
|
||||
menu = Menu.buildFromTemplate(convertToMenuTemplate(items));
|
||||
var createMenu = function(x, y, items, document) {
|
||||
const remote = require('electron').remote;
|
||||
const Menu = remote.Menu;
|
||||
const menu = Menu.buildFromTemplate(convertToMenuTemplate(items));
|
||||
|
||||
// The menu is expected to show asynchronously.
|
||||
return setTimeout(function() {
|
||||
|
@ -57,7 +54,7 @@ createMenu = function(x, y, items, document) {
|
|||
});
|
||||
};
|
||||
|
||||
showFileChooserDialog = function(callback) {
|
||||
var showFileChooserDialog = function(callback) {
|
||||
var dialog, files, remote;
|
||||
remote = require('electron').remote;
|
||||
dialog = remote.dialog;
|
||||
|
@ -67,7 +64,7 @@ showFileChooserDialog = function(callback) {
|
|||
}
|
||||
};
|
||||
|
||||
pathToHtml5FileObject = function(path) {
|
||||
var pathToHtml5FileObject = function(path) {
|
||||
var blob, fs;
|
||||
fs = require('fs');
|
||||
blob = new Blob([fs.readFileSync(path)]);
|
||||
|
@ -75,7 +72,7 @@ pathToHtml5FileObject = function(path) {
|
|||
return blob;
|
||||
};
|
||||
|
||||
createFileSelectorElement = function(callback) {
|
||||
var createFileSelectorElement = function(callback) {
|
||||
var fileSelectorElement;
|
||||
fileSelectorElement = document.createElement('span');
|
||||
fileSelectorElement.style.display = 'none';
|
||||
|
|
Loading…
Reference in a new issue