Class.registerpreprocessor (' ClassName ', function (CLS, data) { if (data. $className) { cls. $className = data.$ ClassName; <debug> cls.displayname = cls. $className; </debug> } //<debug> ext.classsystemmonitor && ext.classsystemmonitor (CLS, ' Ext.classmanager#classnamepreprocessor ', arguments); </debug> }, True, ' first ');
First look at the ClassName processor, which is relatively simple, the third parameter is true, indicating that this is a must be performed by the preprocessor, debug source code debugging.
Ext.define ("My.test.AAA", {aaa: ' AAA ', BBB: ' BBB '});
The CLS can be understood as a class that adds a static property $classname to the class, and by observing My.test.AAA it can be found that it is a function that has some static properties and methods as shown in.
Some of them are inherited from Base.js, and a property $classname is added by the className preprocessor.
My.test.AAA is now added to the global variable, as shown in
ExtJS Source code Analysis ExtJS preprocessor classname