Closed Bug 400001 Opened 18 years ago Closed 16 years ago

please get rid of the strict warnings from addons

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: timeless, Assigned: jeresig)

References

()

Details

Attachments

(1 file)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007101304 Minefield/3.0a9pre steps: 1. enable strict warnings [javascript.options.strict, true] 2. load https://addons.mozilla.org/en-US/firefox/browse/type:4 3. check he js console Warning: function __utmVisitorCode does not always return a value Source File: https://addons.mozilla.org/js/__utm.js Line: 484, Column: 69 Source Code: if ((i2=a.indexOf(".",i+1))>0) r=a.substring(i+1,i2); else return ""; Warning: assignment to undeclared variable i Source File: https://addons.mozilla.org/js/__utm.js Line: 156 Warning: test for equality (==) mistyped as assignment (=)? Source File: https://addons.mozilla.org/js/jquery-compressed.js Line: 12, Column: 53 Source Code: 1){target=this;a=0}var prop;while(prop=arguments[a++])for(var i in prop)target[i]=prop[i];return target};jQuery.extend({noConflict:function(){if(jQuery._$)$=jQuery._$;return jQuery},isFunction:function(fn){return!!fn&&typeof fn!="string"&&typeof fn[0]=="u Warning: anonymous function does not always return a value Source File: https://addons.mozilla.org/js/jquery-compressed.js Line: 12, Column: 164 Source Code: on(e){return rec.test(e.className)});if(m[1]=="#"&&ret.length==1){var tmp=r;r=[];jQuery.each(tmp,function(){if(this.getAttribute("id")==m[2]){r=[this];return false}})}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(va
While I support the basic idea, I am unsure if we want to start fixing upstream bugs with the jquery libraries? But, we should of course stay up to date on it. Maybe some of the issues are fixed with a newer version. Also: woot, 400.000 and 1st bug.
Fred, should we consider a newer JQuery library for v3.2?
Did I not answer to this yet? Oops, I meant to. Anyway, yes we should absolutely look into updating jquery for 3.2; its API likely has not changed, but it could sure help us get rid of these warnings.
Assignee: nobody → fwenzel
The warnings are still there in the latest jQuery (I upgraded it locally and was going to commit it eventually, but feel free.)
Copying jresig, who can probably get these fixed for good, or explain why they aren't!
Severity: normal → trivial
Ah - that's an old version of jQuery - I think the strict issues have been fixed in the latest nightlies. Please let me know if I'm wrong: http://code.jquery.com/jquery-nightly.js
Yes, as a matter of fact the latest jquery-pack download (1.2.1) does not have these errors anymore already. The other warnings are thrown by the urchin tracking package. Thanks, jresig. Anything we can do about Urchin?
New JQuery library is committed to SVN r7879.
Give this rough patch a try (they have a ; instead of a , and a 'return;' instead of a 'return "";").
Ah, perfect, this fixed it, thanks! However, I just noticed that the jquery warnings are not all gone after all (I am unsure how I missed these earlier). In particular there are (and don't mind the jquery-compressed filename, in fact this is where I copied the uncompressed nightly straight off your link): Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 417, Column: 1 Source Code: }, Warning: variable i redeclares argument Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 973, Column: 15 Source Code: for ( var i = tbody.length - 1; i >= 0 ; --i ) Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 2076, Column: 1 Source Code: }, Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 2199, Column: 1 Source Code: })(); Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 2567, Column: 12 Source Code: return xml; Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 2592, Column: 1 Source Code: }, Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 2847, Column: 9 Source Code: return q; Warning: redeclaration of var border Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 3165, Column: 10 Source Code: function border(elem) { Warning: anonymous function does not always return a value Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 3173 Source Code: }; Warning: reference to undefined property jQuery.cache[id][name] Source File: http://fwenzel.khan-vm.mozilla.org/amo/site/js/jquery-compressed.js Line: 629
Hmm... I'll have to take a look at this. I don't have an exact date for when the next version of jQuery will be ready. How critical is this? (I can post an update here when it's ready.)
Considering there is no broken functionality that I can think of, no rush. If you'd comment here again when you have had time to look at it, that'd be great!
Ping John. Any updates to jQuery that resolve this?
Assignee: fwenzel → jresig
We've had a couple updates to jQuery, but I'm unsure if we've resolved those issues. I'll put it on our list to examine for the next release.
In the intervening 1.5 years, this problem has gone away.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: