feature(util) applyConstructor: util -> client

This commit is contained in:
coderaiser 2015-03-20 08:02:33 -04:00
parent f81b643f29
commit 1a0ffd499e
2 changed files with 16 additions and 16 deletions

View file

@ -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, который
* выполняет весь функционал по
* инициализации

View file

@ -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