PDA

View Full Version : [FIXED] Ext.util.Observable always push undefined into listeners



PhongHoang
3 Jun 2014, 12:44 AM
I create new class extend from Ext.util.Observable and override addListener from Observable. It always call addListener with undefined eventName.
Found problem in prepareClass of Ext.util.Observable. k is not set when check and push into listeners



,prepareClass: function(m, k, p) {
var o = m.listeners = [], q = p ? p.listeners : m.prototype.listeners, l, k;
if (k) {
o.push(k.listeners)
} else {
o.push(m.superclass.self.listeners)
}
if (q) {
o.push(q)
}
if (!m.HasListeners) {
var n = function() {
}, j = m.superclass.HasListeners || (k && k.HasListeners) || a.HasListeners;
m.prototype.HasListeners = m.HasListeners = n;
n.prototype = m.hasListeners = new j()
}
}

evant
3 Jun 2014, 1:32 AM
Please post a test case that demonstrates the issue.

PhongHoang
3 Jun 2014, 7:10 PM
Test case: https://fiddle.sencha.com/#fiddle/6b6
It calls addListener with eventName is undefined after create new instance

evant
3 Jun 2014, 8:05 PM
Thanks for the report! I have opened a bug in our bug tracker.