Clean up no-unused-vars lint errors

This commit is contained in:
Kevin Sawicki 2016-01-19 14:49:40 -08:00
parent ccce284a5b
commit 70bcb0ac5a
36 changed files with 228 additions and 344 deletions

View file

@ -2,19 +2,15 @@
const events = require('events');
const path = require('path');
const url = require('url');
const Module = require('module');
// We modified the original process.argv to let node.js load the
// atom-renderer.js, we need to restore it here.
process.argv.splice(1, 1);
// Clear search paths.
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths'));
// Import common settings.
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init'));

View file

@ -43,7 +43,7 @@ var convertToMenuTemplate = function(items) {
return template;
};
var createMenu = function(x, y, items, document) {
var createMenu = function(x, y, items) {
const remote = require('electron').remote;
const Menu = remote.Menu;
const menu = Menu.buildFromTemplate(convertToMenuTemplate(items));

View file

@ -62,21 +62,21 @@ var dispatchEvent = function() {
module.exports = {
registerEvents: function(webView, viewInstanceId) {
ipcRenderer.on("ATOM_SHELL_GUEST_VIEW_INTERNAL_DISPATCH_EVENT-" + viewInstanceId, function() {
var args, event, eventName;
event = arguments[0], eventName = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
var eventName = arguments[1];
var args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
return dispatchEvent.apply(null, [webView, eventName, eventName].concat(slice.call(args)));
});
ipcRenderer.on("ATOM_SHELL_GUEST_VIEW_INTERNAL_IPC_MESSAGE-" + viewInstanceId, function() {
var args, channel, domEvent, event;
event = arguments[0], channel = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
domEvent = new Event('ipc-message');
var channel = arguments[1];
var args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
var domEvent = new Event('ipc-message');
domEvent.channel = channel;
domEvent.args = slice.call(args);
return webView.dispatchEvent(domEvent);
});
return ipcRenderer.on("ATOM_SHELL_GUEST_VIEW_INTERNAL_SIZE_CHANGED-" + viewInstanceId, function() {
var args, domEvent, event, f, i, j, len, ref1;
event = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
var args, domEvent, f, i, j, len, ref1;
args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
domEvent = new Event('size-changed');
ref1 = ['oldWidth', 'oldHeight', 'newWidth', 'newHeight'];
for (i = j = 0, len = ref1.length; j < len; i = ++j) {

View file

@ -87,7 +87,7 @@ class AllowTransparencyAttribute extends BooleanAttribute {
super(webViewConstants.ATTRIBUTE_ALLOWTRANSPARENCY, webViewImpl);
}
handleMutation(oldValue, newValue) {
handleMutation() {
if (!this.webViewImpl.guestInstanceId) {
return;
}
@ -105,7 +105,7 @@ class AutosizeDimensionAttribute extends WebViewAttribute {
return parseInt(this.webViewImpl.webviewNode.getAttribute(this.name)) || 0;
}
handleMutation(oldValue, newValue) {
handleMutation() {
if (!this.webViewImpl.guestInstanceId) {
return;
}

View file

@ -93,15 +93,13 @@ var WebViewImpl = (function() {
this.webviewNode.setAttribute('tabIndex', -1);
}
this.webviewNode.addEventListener('focus', (function(_this) {
return function(e) {
return function() {
// Focus the BrowserPlugin when the <webview> takes focus.
return _this.browserPluginNode.focus();
};
})(this));
return this.webviewNode.addEventListener('blur', (function(_this) {
return function(e) {
return function() {
// Blur the BrowserPlugin when the <webview> loses focus.
return _this.browserPluginNode.blur();
};
@ -138,12 +136,11 @@ var WebViewImpl = (function() {
};
WebViewImpl.prototype.onSizeChanged = function(webViewEvent) {
var height, maxHeight, maxWidth, minHeight, minWidth, newHeight, newWidth, node, width;
var maxHeight, maxWidth, minHeight, minWidth, newHeight, newWidth, node, width;
newWidth = webViewEvent.newWidth;
newHeight = webViewEvent.newHeight;
node = this.webviewNode;
width = node.offsetWidth;
height = node.offsetHeight;
// Check the current bounds to make sure we do not resize <webview>
// outside of current constraints.
@ -296,8 +293,7 @@ var registerBrowserPluginElement = function() {
};
proto.attachedCallback = function() {
// Load the plugin immediately.
var unused;
return unused = this.nonExistentAttribute;
return this.nonExistentAttribute;
};
WebViewImpl.BrowserPlugin = webFrame.registerEmbedderCustomElement('browserplugin', {
"extends": 'object',