Permalink
Browse files

Tolerate

  • Loading branch information...
1 parent b4b188e commit a27d17cd4683a9f0cf6649f5977f72e8a55f3ecb @douglascrockford committed Jun 9, 2011
Showing with 154 additions and 166 deletions.
  1. +1 −10 init_ui.js
  2. +52 −62 jslint.html
  3. +72 −61 jslint.js
  4. +29 −33 lint.html
View
@@ -1,5 +1,5 @@
// init_ui.js
-// 2011-05-31
+// 2011-06-08
// This is the web browser companion to fulljslint.js. It is an ADsafe
// lib file that implements a web ui by adding behavior to the widget's
@@ -22,7 +22,6 @@ ADSAFE.lib("init_ui", function (lib) {
return function (dom) {
var table = dom.q('#JSLINT_TABLE'),
boxes = table.q('span'),
- goodparts = boxes.q('.goodpart'),
indent = dom.q('#JSLINT_INDENT'),
input = dom.q('#JSLINT_INPUT'),
jslintstring = dom.q('#JSLINT_JSLINTSTRING'),
@@ -171,14 +170,6 @@ ADSAFE.lib("init_ui", function (lib) {
show_options();
});
- dom.q('#JSLINT_GOODPARTS').on('click', function () {
- goodparts.each(function (bunch) {
- ADSAFE.set(option, bunch.getTitle(), true);
- });
- option.indent = 4;
- show_options();
- });
-
table.on('click', update_box);
indent.on('change', update_number);
maxerr.on('change', update_number);
View
@@ -166,127 +166,117 @@
WARNING: JSLint can help you improve the quality of your programs.
</div>
</div>
-<p id="JSLINT_JSLINTSTRING"></p>
<pre id="JSLINT_TREE"></pre>
<p>
<input type="button" name="jslint" value="JSLint">
&nbsp; &nbsp;
<input type="button" name="tree" value="Syntax Tree">
&nbsp; &nbsp;
<input type="button" name="clear" value="clear">
+ &nbsp; &nbsp;
+ <input type="button" id="JSLINT_CLEARALL" value="Clear All Options">
</p>
<p id="JSLINT_OPTIONS">
- <table id="JSLINT_TABLE" cols="6"><tbody>
+ <table id="JSLINT_TABLE" border="0">
<tr>
- <td><span title="white" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="white">Strict white space</td>
<td><span title="devel">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="devel">Assume&nbsp;<code>console</code>,&nbsp;<code>alert</code>,&nbsp;...</td>
- <td><span title="debug">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="debug">Tolerate&nbsp;<tt>debugger</tt>&nbsp;statements</td>
+ <td><span title="bitwise">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="bitwise">Tolerate bitwise operators</td>
+ <td><span title="unparam">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="unparam">Tolerate&nbsp;unused&nbsp;parameters</td>
</tr>
<tr>
- <td><span title="onevar" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="onevar">Allow one&nbsp;<tt>var</tt>&nbsp;statement per function</td>
<td><span title="browser">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="browser">Assume a browser</td>
- <td><span title="evil">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="evil">Tolerate&nbsp;<tt>eval</tt></td>
+ <td><span title="continue">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="continue">Tolerate&nbsp;<tt>continue</tt></td>
+ <td><span title="sloppy">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="sloppy">Tolerate&nbsp;missisng&nbsp;<code>'use&nbsp;strict'</code>&nbsp;pragma</td>
</tr>
<tr>
- <td><span title="undef" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="undef">Disallow undefined variables</td>
<td><span title="node">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="node">Assume&nbsp;<a href="http://nodejs.org/">Node.js</a></td>
- <td><span title="forin">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="forin">Tolerate&nbsp;<a href="http://yuiblog.com/blog/2006/09/26/for-in-intrigue/">unfiltered</a>&nbsp;<tt>for</tt> <tt>in</tt></td>
+ <td><span title="debug">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="debug">Tolerate&nbsp;<tt>debugger</tt>&nbsp;statements</td>
+ <td><span title="sub">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="sub">Tolerate&nbsp;inefficient&nbsp;subscripting</td>
</tr>
<tr>
- <td><span title="nomen" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="nomen">Disallow dangling&nbsp;<tt>_</tt>&nbsp;in identifiers</td>
<td><span title="rhino">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="rhino">Assume&nbsp;<a href="http://www.mozilla.org/rhino/">Rhino</a></td>
- <td><span title="sub">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="sub">Tolerate inefficient subscripting</td>
+ <td><span title="es5">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="es5">Tolerate&nbsp;ES5&nbsp;syntax</td>
+ <td><span title="type">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="type">Tolerate&nbsp;type&nbsp;inconsistency</td>
</tr>
<tr>
- <td><span title="regexp" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="regexp">Disallow&nbsp;<tt>.</tt>&nbsp;and&nbsp;<tt>[^</tt>...<tt>]</tt>&nbsp;in&nbsp;/RegExp/</td>
<td><span title="widget">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="widget">Assume a&nbsp;<a href="http://widgets.yahoo.com/tools/">Yahoo Widget</a></td>
- <td><span title="type">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="type">Tolerate&nbsp;type&nbsp;inconsistency</td>
+ <td><span title="evil">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="evil">Tolerate&nbsp;<tt>eval</tt></td>
+ <td><span title="vars">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="vars">Tolerate many&nbsp;<tt>var</tt>&nbsp;statements per function</td>
</tr>
<tr>
- <td><span title="plusplus" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="plusplus">Disallow&nbsp;<tt>++</tt>&nbsp;and&nbsp;<tt>--</tt></td>
<td><span title="windows">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="windows">Assume Windows</td>
- <td><span title="continue">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="continue">Tolerate&nbsp;<tt>continue</tt></td>
- </tr>
- <tr>
- <td><span title="bitwise" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="bitwise">Disallow bitwise operators</td>
- <td><span title="passfail">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="passfail">Stop on first error</td>
- <td><span title="unparam">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="unparam">Tolerate unused parameters</td>
+ <td title="windows">Assume&nbsp;Windows</td>
+ <td><span title="forin">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="forin">Tolerate&nbsp;<a href="http://yuiblog.com/blog/2006/09/26/for-in-intrigue/">unfiltered</a>&nbsp;<tt>for</tt>&nbsp;<tt>in</tt></td>
+ <td><span title="white">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="white">Tolerate&nbsp;messy&nbsp;white space</td>
</tr>
<tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td><span title="es5">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="es5">Tolerate ES5 syntax</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><span title="newcap">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="newcap">Tolerate uncapitalized constructors</td>
+ <td>&nbsp;</td>
+ <td title="sloppy">&nbsp;</td>
</tr>
<tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
+ <td><span title="passfail">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="passfail">Stop&nbsp;on&nbsp;first&nbsp;error</td>
+ <td><span title="nomen">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="nomen">Tolerate dangling&nbsp;<tt>_</tt>&nbsp;in identifiers</td>
<td><span title="css">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="css">Tolerate CSS workarounds</td>
+ <td title="css">Tolerate&nbsp;CSS&nbsp;workarounds</td>
</tr>
<tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><span title="plusplus">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="plusplus">Tolerate&nbsp;<tt>++</tt>&nbsp;and&nbsp;<tt>--</tt></td>
<td><span title="cap">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="cap">Tolerate&nbsp;<tt>HTML</tt>&nbsp;case</td>
</tr>
<tr>
- <td><span title="newcap" class="goodpart">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="newcap">Require Initial Caps for constructors</td>
<td><span title="safe">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="safe">Safe Subset</td>
+ <td title="safe">Safe&nbsp;Subset</td>
+ <td><span title="regexp">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="regexp">Tolerate&nbsp;<tt>.</tt>&nbsp;and&nbsp;<tt>[^</tt>...<tt>]</tt>&nbsp;in&nbsp;/RegExp/</td>
<td><span title="on">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="on">Tolerate&nbsp;<tt>HTML</tt>&nbsp;event handlers</td>
</tr>
<tr>
- <td><span title="strict" class="box goodparts">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
- <td title="strict">Require&nbsp;<tt>'use strict';</tt></td>
<td><span title="adsafe">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="adsafe">Verify&nbsp;<a href="http://www.ADsafe.org">ADsafe</a></td>
+ <td><span title="undef">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td title="undef">Tolerate&nbsp;misordered&nbsp;definitions</td>
<td><span title="fragment">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
<td title="fragment">Tolerate&nbsp;<tt>HTML</tt>&nbsp;fragments</td>
</tr>
- </tbody></table>
- <br clear=all>
-<div class="leftcolumn">
- <input type="button" id="JSLINT_GOODPARTS" value="The Good Parts">
- <br><br>
- <input type="button" id="JSLINT_CLEARALL" value="Clear All Options">
-</div>
+ </table>
+ <p><br clear=all>
+ </p>
<div id=JSLINT_FIELDS>
<input id="JSLINT_INDENT" type="text" size="2" title="indent" value="" autocomplete=off> <label for="JSLINT_INDENT" title="indent">Indentation</label><br>
<input id="JSLINT_MAXLEN" type="text" size="2" title="maxlen" value="" autocomplete=off> <label for="JSLINT_MAXLEN" title="maxlen">Maximum line length</label><br>
<input id="JSLINT_MAXERR" type="text" size="2" title="maxerr" value="" autocomplete=off> <label for="JSLINT_MAXERR" title="maxerr">Maximum number of errors</label><br>
<label title=predef for="JSLINT_PREDEF">Predefined&nbsp;<small>(&nbsp;<code>,</code>&nbsp;separated)</small></label>&nbsp;<input id="JSLINT_PREDEF" type="text" size="72" autocomplete=off title=predef>
</div>
</p>
+<p id="JSLINT_JSLINTSTRING"></p>
<p> Copyright 2002&nbsp;<a href="http://www.JSLint.com/lint.html">Douglas
Crockford.</a>&nbsp;<a target="_blank" href="http://www.crockford.com/">All
Rights Reserved Wrrrldwide and Beyond!</a> <br>
Oops, something went wrong.

1 comment on commit a27d17c

@patrio
patrio commented on a27d17c Jun 9, 2011

Uber, have silently been waiting for this change all the time :D

Please sign in to comment.