Last modified: 2006-07-06 23:24:29 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 6565 - Adding some var declarations to MediaWiki's JavaScript.
Adding some var declarations to MediaWiki's JavaScript.
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-07-06 10:01 UTC by Nick Jenkins
Modified: 2006-07-06 23:24 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Wikibits var declarations (756 bytes, patch)
2006-07-06 10:01 UTC, Nick Jenkins

Description Nick Jenkins 2006-07-06 10:01:09 UTC
Adding some var declarations to MediaWiki's JavaScript for maximum correctness
for issues reported by "FireBug" (a firefox JavaScript correctness checking
extension). Will attach a diff with these shortly. 

Also the place in the default [[MediaWiki:Monobook.js]] where the tooltip /
access key JS is declared should be updated like so:
   /* tooltips and access keys */
-  ta = new Object();
+  var ta = new Object();
   ta['pt-userpage'] = new Array('.','My user page');
   ta['pt-anonuserpage'] = new Array('.','The user page for the ip you\'re
editing as');
Comment 1 Nick Jenkins 2006-07-06 10:01:59 UTC
Created attachment 2052 [details]
Wikibits var declarations

Attaching diff with var declarations as per above.
Comment 2 Rotem Liss 2006-07-06 11:04:59 UTC
Comment 3 Nick Jenkins 2006-07-06 11:42:02 UTC
Thank you!
Comment 4 Brion Vibber 2006-07-06 16:59:12 UTC
Er, what's wrong here? These are global declarations.
Comment 5 Nick Jenkins 2006-07-06 23:24:29 UTC
Omitting the var will still work; but from my understanding using var is

Quoting from the Core JavaScript 1.5 Reference (
) :
"The scope of a variable is the current function or, for variables declared
outside a function, the current application. Using var outside a function is
optional; assigning a value to an undeclared variable implicitly declares it as
a global variable. However, it is recommended to always use var."

Note You need to log in before you can comment on or make changes to this bug.