PDA

View Full Version : [FIXED-437][3.1] removeListener('unload') fails



Condor
18 Jan 2010, 12:49 AM
ext-base-event.js

removeListener: function(el, eventName, fn) {
el = Ext.getDom(el);
var i, len, li, lis;
if (el && fn) {
if(eventName == UNLOAD){
if((lis = unloadListeners[el.id]) !== undefined){
for(i = 0, len = lis.length; i < len; i++){
if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){
unloadListeners[el.id].splice(i, 1);
}
}
}
return;
}
doRemove(el, eventName, fn, false);
}
},

This was the most important error returned by JSLint, but there are lots more!

Can somebody PLEASE run the entire codebase through JSLint?
(I could do it, but I don't have SVN write privileges)

MartiCode
18 Jan 2010, 1:13 AM
I guess this would explain the issue I'm having here :
http://www.extjs.com/forum/showthread.php?t=89850

edspencer
18 Jan 2010, 1:22 AM
I just ran the snippet you posted though JSLint and it only found implied global variables for variables such as Ext and the local vars like UNLOAD. What is the error you're referring to?

Ext JS has something like 80 warnings in the source code currently (mostly missing semicolons), but no errors. I'm cleaning up the warnings this morning as it has bugged me for ages.

Condor
18 Jan 2010, 1:34 AM
I ran ext-base-debug.js and ext-all-debug.js through fulljslint.js (modified to not stop after 50 warnings).

This was the only global variable reference I found, but there are lots of other warnings about invalid javascript (most of which are ignored by browsers, but IMHO these should be fixed anyway).

Example:

Ext.EventManager.on(window, 'unload', function(){
delete /*EC*/Ext.elCache;
delete El._flyweights;
});

edspencer
18 Jan 2010, 1:42 AM
Ok I'll keep poking around. Agreed that these should be fixed even if they're not currently causing any problems - it just feels dirty at the moment.

Jamie Avins
18 Jan 2010, 9:40 AM
I've dug through the unload issue already Ed. I'll bug this so I can put in the necessary updates.

Jamie Avins
19 Jan 2010, 2:39 PM
unload event from Element has been moved to EventManager's _unload since we don't want to dump the cache until the very end. Also fixed the global in the adapter.

Jamie Avins
19 Jan 2010, 2:40 PM
I think Ed is taking on the large issue with all the other lint warnings.