Use rest parameters
This commit is contained in:
parent
e05804848f
commit
8889c29866
14 changed files with 88 additions and 143 deletions
|
@ -9,8 +9,6 @@ const bindings = process.atomBinding('app');
|
|||
const downloadItemBindings = process.atomBinding('download_item');
|
||||
const app = bindings.app;
|
||||
|
||||
var slice = [].slice;
|
||||
|
||||
app.__proto__ = EventEmitter.prototype;
|
||||
|
||||
app.setApplicationMenu = function(menu) {
|
||||
|
@ -57,10 +55,8 @@ app.getAppPath = function() {
|
|||
// Routes the events to webContents.
|
||||
var ref1 = ['login', 'certificate-error', 'select-client-certificate'];
|
||||
var fn = function(name) {
|
||||
return app.on(name, function() {
|
||||
var args, event, webContents;
|
||||
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 app.on(name, function(event, webContents, ...args) {
|
||||
return webContents.emit.apply(webContents, [name, event].concat(args));
|
||||
});
|
||||
};
|
||||
var i, len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue