mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(client) rm applyConstructor
This commit is contained in:
parent
2239f47d45
commit
d401a6c33b
1 changed files with 1 additions and 16 deletions
|
|
@ -162,7 +162,7 @@ function CloudCmdProto(Util, DOM) {
|
|||
if (error || !itype.function(Proto))
|
||||
return;
|
||||
|
||||
CloudCmd[name] = applyConstructor(Proto, args);
|
||||
CloudCmd[name] = new Proto(...args);
|
||||
};
|
||||
|
||||
return DOM.load.js(pathFull, func || done);
|
||||
|
|
@ -171,21 +171,6 @@ function CloudCmdProto(Util, DOM) {
|
|||
CloudCmd[name][funcName] = CloudCmd[name];
|
||||
}
|
||||
|
||||
/*
|
||||
* apply arguemnts to constructor
|
||||
*
|
||||
* @param constructor
|
||||
* @param args
|
||||
*/
|
||||
function applyConstructor(constructor, args) {
|
||||
const F = function () {
|
||||
return constructor.apply(this, args);
|
||||
};
|
||||
|
||||
F.prototype = constructor.prototype;
|
||||
return new F();
|
||||
}
|
||||
|
||||
/**
|
||||
* Конструктор CloudClient, который
|
||||
* выполняет весь функционал по
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue