Permalink
Browse files

asignment unwrapped

  • Loading branch information...
douglascrockford committed Jan 31, 2011
1 parent 8eb6227 commit 9d80d800666f979e5d95e37fef97caa584710978
Showing with 10 additions and 12 deletions.
  1. +9 −6 fulljslint.js
  2. +1 −6 lint.html
View
@@ -1,5 +1,5 @@
// jslint.js
-// 2011-01-27
+// 2011-01-28
/*
Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
@@ -3794,10 +3794,13 @@ loop: for (;;) {
if (!id) {
if (nexttoken.id === '(string)') {
id = nexttoken.value;
- if (option.adsafe &&
- (id.charAt(0) === '_' ||
- id.charAt(id.length - 1) === '_')) {
- warning(bundle.dangling_a, token);
+ if (option.safe) {
+ if (banned[id]) {
+ warning(bundle.adsafe_a);
+ } else if (id.charAt(0) === '_' ||
+ id.charAt(id.length - 1) === '_') {
+ warning(bundle.dangling_a);
+ }
}
advance();
} else if (nexttoken.id === '(number)') {
@@ -6215,7 +6218,7 @@ loop: for (;;) {
};
itself.jslint = itself;
- itself.edition = '2011-01-27';
+ itself.edition = '2011-01-28';
return itself;
View
@@ -265,12 +265,7 @@ <h2 id=assignment>=</h2>
...
}</pre>
<p>It is difficult to write correct programs while using idioms that are
- hard to distinguish from obvious errors. If you really intend an assignment,
- wrap it in another set of parens:</p>
-<pre>if ((a = b)) {
- ...
-}</pre>
-
+ hard to distinguish from obvious errors.</p>
<h2 id=equal>== and !=</h2>
<p>The <code>==</code> and <code>!=</code> operators do type coercion before
comparing. This is bad because it causes <code>' \t\r\n' == 0</code> to

0 comments on commit 9d80d80

Please sign in to comment.