Ext.create方法分析
程序员文章站
2022-07-09 21:34:38
Ext.create方法实际上是Ext.ClassManager的instantiate的别名 分析如下: ......
ext.create方法实际上是ext.classmanager的instantiate的别名
分析如下:
1 (function(class, alias, arrayslice, arrayfrom, global) { 2 var manager = ext.classmanager = {... 3 } 4 ... 5 ext.apply(ext, { 6 7 create: alias(manager, 'instantiate'), 8 ... 9 }); 10 ... 11 }(ext.class, ext.function.alias, array.prototype.slice, ext.array.from, ext.global)); 12 13 create: alias(manager, 'instantiate') 14 15 create: ext.function.alias(ext.classmanager, 'instantiate') 16 17 ext.function = { 18 alias: function(object, methodname) { 19 return function() { 20 return object[methodname].apply(object, arguments); 21 }; 22 }, 23 ... 24 } 25 26 create: function() { 27 return object[methodname].apply(object, arguments); 28 } 29 30 create: function() { 31 return ext.classmanager['instantiate'].apply(ext.classmanager, arguments); 32 }