Clean up no-unused-vars lint errors
This commit is contained in:
parent
ccce284a5b
commit
70bcb0ac5a
36 changed files with 228 additions and 344 deletions
|
@ -1,4 +1,3 @@
|
|||
const EventEmitter = require('events').EventEmitter;
|
||||
const binding = process.atomBinding('ipc');
|
||||
const v8Util = process.atomBinding('v8_util');
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ deprecate.warn('ipc module', 'require("electron").ipcRenderer');
|
|||
var ipc = new EventEmitter;
|
||||
|
||||
ipcRenderer.emit = function() {
|
||||
var args, channel, event;
|
||||
channel = arguments[0], event = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
|
||||
var channel = arguments[0]
|
||||
var args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
|
||||
ipc.emit.apply(ipc, [channel].concat(slice.call(args)));
|
||||
return EventEmitter.prototype.emit.apply(ipcRenderer, arguments);
|
||||
};
|
||||
|
|
|
@ -87,7 +87,7 @@ var wrapArgs = function(args, visited) {
|
|||
|
||||
// Convert meta data from browser into real value.
|
||||
var metaToValue = function(meta) {
|
||||
var RemoteFunction, el, i, j, len, len1, member, ref1, ref2, results, ret;
|
||||
var el, i, j, len, len1, member, ref1, ref2, results, ret;
|
||||
switch (meta.type) {
|
||||
case 'value':
|
||||
return meta.value;
|
||||
|
@ -114,7 +114,7 @@ var metaToValue = function(meta) {
|
|||
default:
|
||||
if (meta.type === 'function') {
|
||||
// A shadow class to represent the remote function object.
|
||||
ret = RemoteFunction = (function() {
|
||||
ret = (function() {
|
||||
function RemoteFunction() {
|
||||
var obj;
|
||||
if (this.constructor === RemoteFunction) {
|
||||
|
@ -189,8 +189,7 @@ var metaToPlainObject = function(meta) {
|
|||
// This function's content should not be inlined into metaToValue, otherwise V8
|
||||
// may consider it circular reference.
|
||||
var createRemoteMemberFunction = function(metaId, name) {
|
||||
var RemoteMemberFunction;
|
||||
return RemoteMemberFunction = (function() {
|
||||
return (function() {
|
||||
function RemoteMemberFunction() {
|
||||
var ret;
|
||||
if (this.constructor === RemoteMemberFunction) {
|
||||
|
|
|
@ -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'));
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue