Use rest parameters
This commit is contained in:
parent
e05804848f
commit
8889c29866
14 changed files with 88 additions and 143 deletions
|
@ -1,7 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
var slice = [].slice;
|
||||
|
||||
const v8Util = process.atomBinding('v8_util');
|
||||
|
||||
class CallbacksRegistry {
|
||||
|
@ -46,16 +44,14 @@ class CallbacksRegistry {
|
|||
return (ref = this.callbacks[id]) != null ? ref : function() {};
|
||||
}
|
||||
|
||||
call() {
|
||||
var args, id, ref;
|
||||
id = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
|
||||
return (ref = this.get(id)).call.apply(ref, [global].concat(slice.call(args)));
|
||||
call(id, ...args) {
|
||||
var ref;
|
||||
return (ref = this.get(id)).call.apply(ref, [global].concat(args));
|
||||
}
|
||||
|
||||
apply() {
|
||||
var args, id, ref;
|
||||
id = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
|
||||
return (ref = this.get(id)).apply.apply(ref, [global].concat(slice.call(args)));
|
||||
apply(id, ...args) {
|
||||
var ref;
|
||||
return (ref = this.get(id)).apply.apply(ref, [global].concat(args));
|
||||
}
|
||||
|
||||
remove(id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue