Last modified: 2006-11-15 08:01:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8839, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6839 - Wikibits.js minor changes to keep JS-lint happy
Wikibits.js minor changes to keep JS-lint happy
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.8.x
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


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

Description Nick Jenkins 2006-07-28 03:48:49 UTC
Will shortly attach a diff of a patch used to make JS-lint (
http://www.jslint.com/ ) 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
painlessly).

There are still a few remaining things; To reproduce the remaining errors, go to
http://www.jslint.com/ , 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

    toggleLink.appendChild(document.createTextNode(tocHideText));

    Problem at line 294 character 4: Undefined function: toggleToc

    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

    addRightClickEditHandler(el);

    Problem at line 575 character 4: Undefined function: addCheckboxClickHandlers

    addCheckboxClickHandlers(uls[i]);

    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.


Navigation
Links