Last modified: 2006-11-15 08:01:17 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 6839 - Wikibits.js minor changes to keep JS-lint happy
Wikibits.js minor changes to keep JS-lint happy
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-07-28 03:48 UTC by Nick Jenkins
Modified: 2006-11-15 08:01 UTC (History)
0 users

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

Make js-lint happier with Wikibits.js (15.69 KB, patch)
2006-07-28 03:49 UTC, Nick Jenkins

Description Nick Jenkins 2006-07-28 03:48:49 UTC
Will shortly attach a diff of a patch used to make JS-lint ( ) happier with wikibits.js

Mostly it just adds braces around every if and else statement, in order to be
explicit. There are also a few var declarations added, and a few semi-colons added.

There are a few other additional things that it complains about, and which
aren't addressed in this patch, e.g.:
Problem at line 183 character 21: Use the array literal notation [].

var sections = new Array();

Problem at line 194 character 25: Use the object literal notation {}.

sections[seci] = new Object();
Comment 1 Nick Jenkins 2006-07-28 03:49:20 UTC
Created attachment 2161 [details]
Make js-lint happier with Wikibits.js
Comment 2 Nick Jenkins 2006-11-15 08:01:17 UTC
Done in r17697 (for the minor things that can be done quickly and hopefully

There are still a few remaining things; To reproduce the remaining errors, go to , and:
Tick: "Lax line break ending"
Tick: "Detect undefined variables"
Tick: "Tolerate eval"
Tick: "Assume a browser"
Then open the contents of wikibits.js in a browser, and copy/paste the contents
of wikibits.js into the box, and click "JsLint".

Example output of what remains:


    Problem at line 39 character 12: Undefined variable: stylepath

    if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {

    Problem at line 39 character 47: Undefined variable: skin

    if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {

    Problem at line 200 character 31: Undefined variable: uncoversection

    a.onmousedown = a.onclick = uncoversection;

    Problem at line 282 character 19: JavaScript URL.

    toggleLink.href = 'javascript:toggleToc()';

    Problem at line 283 character 50: Undefined variable: tocHideText


    Problem at line 294 character 4: Undefined function: toggleToc


    Problem at line 313 character 26: Undefined variable: tocHideText

    changeText(toggleLink, tocHideText);

    Problem at line 317 character 26: Undefined variable: tocShowText

    changeText(toggleLink, tocShowText);

    Problem at line 351 character 3: Undefined function: insertTags

    insertTags(item.tagOpen, item.tagClose, item.sampleText);

    Problem at line 386 character 9: Undefined function: escapeQuotesHTML

    return escapeQuotesHTML(text);

    Problem at line 472 character 13: Undefined variable: ta

    if (typeof ta == "undefined" || !ta) {

    Problem at line 530 character 5: Undefined function: addRightClickEditHandler


    Problem at line 575 character 4: Undefined function: addCheckboxClickHandlers


    Problem at line 606 character 19: Undefined variable: checkboxMouseupHandler

    cb.onmouseup = checkboxMouseupHandler;

    Problem at line 729 character 21: Undefined variable: allmessages_prev

    if ( text.length > allmessages_prev.length ) {

    Problem at line 731 character 8: Undefined function: allmessagesforeach

    j = allmessagesforeach(items, i, j);

    Problem at line 773 character 2: Undefined variable: allmessages_modified

    allmessages_modified = !allmessages_modified;

    Problem at line 797 character 2: Undefined variable: allmessages_prev

    allmessages_prev = '';

    Problem at line 798 character 2: Undefined variable: allmessages_modified

    allmessages_modified = false;

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