mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-12 15:25:47 +01:00
Replace Array.slice conversions of the arguments object with rest parameters.
This commit is contained in:
@@ -65,14 +65,13 @@ var Modules = function Modules(window) {
|
||||
*
|
||||
* @returns {function} The constructor for the resulting module.
|
||||
*/
|
||||
function Module(name) {
|
||||
let args = Array.slice(arguments);
|
||||
function Module(name, ...args) {
|
||||
|
||||
var base = ModuleBase;
|
||||
if (callable(args[1]))
|
||||
base = args.splice(1, 1)[0];
|
||||
if (callable(args[0]))
|
||||
base = args.shift();
|
||||
|
||||
let [, prototype, classProperties, moduleInit] = args;
|
||||
let [prototype, classProperties, moduleInit] = args;
|
||||
prototype._metaInit_ = function () {
|
||||
delete module.prototype._metaInit_;
|
||||
Class.replaceProperty(modules, module.className, this);
|
||||
|
||||
Reference in New Issue
Block a user