Skip to content

Commit

Permalink
Weird relation.
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascrockford committed Feb 2, 2011
1 parent 9d80d80 commit cdcbad4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions fulljslint.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// jslint.js
// 2011-01-28
// 2011-02-02

/*
Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
Expand Down Expand Up @@ -303,9 +303,9 @@ SOFTWARE.
unrecognized_tag_a, unsafe, unused, unwatch, updateNow, url, urls,
use_array, use_braces, use_object, used_before_a, value, valueOf, var,
var_a_not, version, "vertical-align", video, violet, visibility, was,
watch, weird_new, weird_program, wheat, while, white, "white-space",
whitesmoke, widget, width, window, windowframe, windows, windowtext,
"word-spacing", "word-wrap", wrap, wrap_immediate, wrap_regexp,
watch, weird_new, weird_program, weird_relation, wheat, while, white,
"white-space", whitesmoke, widget, width, window, windowframe, windows,
windowtext, "word-spacing", "word-wrap", wrap, wrap_immediate, wrap_regexp,
write_is_wrong, yahooCheckLogin, yahooLogin, yahooLogout, yellow,
yellowgreen, "z-index", "}"
*/
Expand Down Expand Up @@ -609,6 +609,7 @@ var JSLINT = (function () {
var_a_not: "Variable {a} was not declared correctly.",
weird_new: "Weird construction. Delete 'new'.",
weird_program: "Weird program.",
weird_relation: "Weird relation.",
wrap_immediate: "Wrap an immediate function invocation in parentheses " +
"to assist the reader in understanding that the expression " +
"is the result of a function, and not the function itself.",
Expand Down Expand Up @@ -2841,6 +2842,10 @@ loop: for (;;) {
warning(bundle.expected_a_b, that, eqeq, that.id);
} else if (left.id === 'NaN' || right.id === 'NaN') {
warning(bundle.isNaN, that);
} else if ((left.identifier && right.identifier && left.value === right.value) ||
((left.id === '(string)' || left.id === '(number)') &&
(right.id === '(string)' || right.id === '(number)'))) {
warning(bundle.weird_relation, that);
}
if (left.id === '!') {
warning(bundle.confusing_a, left);
Expand Down Expand Up @@ -6218,7 +6223,7 @@ loop: for (;;) {
};
itself.jslint = itself;

itself.edition = '2011-01-28';
itself.edition = '2011-02-02';

return itself;

Expand Down

0 comments on commit cdcbad4

Please sign in to comment.