blob: c312b246529536a9ca20a1c05064a6bb262a24da [file] [log] [blame]
function createElement(parent,child,params){
if(child){
child.prototype = Object.create(parent.prototype);
child.prototype.constructor = child;
child.prototype._parent = parent.prototype;
}else{
var instance = Object.create(parent.prototype,params);
var getType = {};
if(instance && getType.toString.call(instance.init) === '[object Function]'){
instance.init();
}
return instance;
}
}
function extendPrototype(source,destination){
for (var attr in source.prototype) {
if (source.prototype.hasOwnProperty(attr)) destination.prototype[attr] = source.prototype[attr];
}
}