From 1a0ffd499eb91b9e51d1c7bf80325bb96fb8ae84 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 20 Mar 2015 08:02:33 -0400 Subject: [PATCH] feature(util) applyConstructor: util -> client --- lib/client.js | 17 ++++++++++++++++- lib/util.js | 15 --------------- 2 files changed, 16 insertions(+), 16 deletions(-) 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