diff --git a/lib/client.js b/lib/client.js index 2fc796bb..fa047fa3 100644 --- a/lib/client.js +++ b/lib/client.js @@ -119,7 +119,7 @@ var Util, DOM, CloudFunc, join; var Proto = CloudCmd[name]; if (!error && type.function(Proto)) - CloudCmd[name] = Util.applyConstructor(Proto, args); + CloudCmd[name] = applyConstructor(Proto, args); }); }; @@ -128,6 +128,21 @@ var Util, DOM, CloudFunc, join; } } + /* + * apply arguemnts to constructor + * + * @param constructor + * @param args + */ + function applyConstructor(constructor, args) { + var F = function () { + return constructor.apply(this, args); + }; + + F.prototype = constructor.prototype; + return new F(); + } + /** Конструктор CloudClient, который * выполняет весь функционал по * инициализации diff --git a/lib/util.js b/lib/util.js index 02566ae8..b906fd7b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -11,21 +11,6 @@ function UtilProto() { var Util = this; - /* - * apply arguemnts to constructor - * - * @param constructor - * @param args - */ - this.applyConstructor = function(constructor, args) { - var F = function () { - return constructor.apply(this, args); - }; - - F.prototype = constructor.prototype; - return new F(); - }; - /** * Функция ищет в имени файла расширение * и если находит возвращает true