PDA

View Full Version : [OPEN] [4.2.0] Minor : Ext.app.Controller :: onClassExtended has duplicate lexical reference



jay@moduscreate.com
23 Apr 2013, 5:38 AM
Extremely minor:



onClassExtended: function(cls, data, hooks) {
var onBeforeClassCreated = hooks.onBeforeCreated;

hooks.onBeforeCreated = function(cls, data) {
var Controller = Ext.app.Controller,
ctrlRegex = Controller.controllerRegex,
requires = [],
className, namespace, requires, proto, match;

proto = cls.prototype;

/*
* Namespace resolution is tricky business: we should know what namespace
* this Controller descendant belongs to, or model/store/view dependency
* resolution will be either ambiguous or plainly not possible. To avoid
* guessing games we try to look for a forward hint ($namespace) that
* Application class sets when its onClassExtended gets processed; if that
* fails we try to deduce namespace from class name.
*
* Note that for Ext.app.Application, Controller.onClassExtended gets executed
* *before* Application.onClassExtended so we have to delay namespace handling
* until after Application.onClassExtended kicks in, hence it is done in this hook.
*/
className = Ext.getClassName(cls);
namespace = data.$namespace ||
Ext.app.getNamespace(className) ||
((match = ctrlRegex.exec(className)) && match[1]);

if (namespace) {
proto.$namespace = namespace;
}
//<debug>
else {
Ext.log.warn("Missing namespace for " + className + ", please define it "+
"in namespaces property of your Application class.");
}
//</debug>

Controller.processDependencies(proto, requires, namespace, 'model', data.models);
Controller.processDependencies(proto, requires, namespace, 'view', data.views);
Controller.processDependencies(proto, requires, namespace, 'store', data.stores);
Controller.processDependencies(proto, requires, namespace, 'controller', data.controllers);

Ext.require(requires, Ext.Function.pass(onBeforeClassCreated, arguments, this));
};
},

slemmon
23 Apr 2013, 9:10 AM
Thanks for the report! I have opened a bug in our bug tracker.