PDA

View Full Version : [INFOREQ] Ext event query gets into infinite loop



halcwb
27 Sep 2011, 3:35 AM
This code get's into a loop when selectorMatch is undefined (Ext. 4.0.6, line 14712).



for (i = 0; selector && i < length; i++) {
matcher = matchers[i];
selectorMatch = selector.match(matcher.re);
method = matcher.method;





if (selectorMatch) {
operations.push({
method: Ext.isString(matcher.method)



? Ext.functionFactory('items', Ext.String.format.apply(Ext.String, [method].concat(selectorMatch.slice(1))))
: matcher.method,
args: selectorMatch.slice(1)
});
selector = selector.replace(selectorMatch[0], '');
break;
}
}


What's more, I ran into this loop when registering an event handler like this:



'button[action=addPackage}':
{
click: me.onAddPackage
},




If I perform a component query from the console like: Ext.ComponentQuery.query('button[action=addPackage]'), the button is returned without any problems.

Edit: I made a typo in the selector matcher.

evant
27 Sep 2011, 3:56 AM
I'm not really following, please post a test case.

halcwb
27 Sep 2011, 5:52 AM
If I past the following code in my application window, the window crashes (code get's into infinite loop as posted above). If I post the code in the console of the Sencha website, I get the expected error of invalid selector.



Ext.create('Ext.window.Window', { title: 'test', height: 100, width: 50}).show(); Ext.ComponentQuery.query('window[title=test}');


Maybe this has something to do that I have Ext.loader enabled?

evant
27 Sep 2011, 5:59 AM
Ok, but I don't know what your application consists of, so I can't really say one way or another.