Ext.create方法分析
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 }