[javascriptlint-commit] SF.net SVN: javascriptlint:[386] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2018-06-13 13:54:52
|
Revision: 386
http://sourceforge.net/p/javascriptlint/code/386
Author: matthiasmiller
Date: 2018-06-13 13:54:50 +0000 (Wed, 13 Jun 2018)
Log Message:
-----------
Rename "unexpected_not_for_in" to "unexpected_not_in".
Modified Paths:
--------------
trunk/javascriptlint/lintwarnings.py
trunk/tests/warnings/for_in_missing_identifier.js
trunk/tests/warnings/unexpected_not_comparison.js
Added Paths:
-----------
trunk/tests/warnings/unexpected_not_in.js
Modified: trunk/javascriptlint/lintwarnings.py
===================================================================
--- trunk/javascriptlint/lintwarnings.py 2018-06-10 20:41:58 UTC (rev 385)
+++ trunk/javascriptlint/lintwarnings.py 2018-06-13 13:54:50 UTC (rev 386)
@@ -107,7 +107,7 @@
'e4x_deprecated': 'e4x is deprecated',
'ambiguous_numeric_prop': 'numeric property should be normalized; use {normalized}',
'duplicate_property': 'duplicate property in object initializer',
- 'unexpected_not_for_in': 'the ! operator is unexpected; add clarifying parentheses',
+ 'unexpected_not_in': 'the ! operator is unexpected; add clarifying parentheses',
'unexpected_not_comparison': 'the ! operator is unexpected; add clarifying parentheses or compare against !!',
}
@@ -692,7 +692,7 @@
raise LintWarning(node)
@lookfor((tok.UNARYOP, op.NOT))
-def unexpected_not_for_in(node):
+def unexpected_not_in(node):
# Avoid for(!s in o)
if node.parent and node.parent.kind == tok.IN:
raise LintWarning(node)
Modified: trunk/tests/warnings/for_in_missing_identifier.js
===================================================================
--- trunk/tests/warnings/for_in_missing_identifier.js 2018-06-10 20:41:58 UTC (rev 385)
+++ trunk/tests/warnings/for_in_missing_identifier.js 2018-06-13 13:54:50 UTC (rev 386)
@@ -7,6 +7,6 @@
for (var prop2 in o)
o[prop2]++;
- for (!prop in o) /*warning:for_in_missing_identifier*/ /*warning:unexpected_not_for_in*/
+ for (!prop in o) /*warning:for_in_missing_identifier*/ /*warning:unexpected_not_in*/
o[prop]++;
}
Modified: trunk/tests/warnings/unexpected_not_comparison.js
===================================================================
--- trunk/tests/warnings/unexpected_not_comparison.js 2018-06-10 20:41:58 UTC (rev 385)
+++ trunk/tests/warnings/unexpected_not_comparison.js 2018-06-13 13:54:50 UTC (rev 386)
@@ -18,10 +18,6 @@
return false;
}
- if (!s in o) { /*warning:unexpected_not_for_in*/
- return false;
- }
-
// Allow ! and !!
if (!!i == b) {
return false;
Added: trunk/tests/warnings/unexpected_not_in.js
===================================================================
--- trunk/tests/warnings/unexpected_not_in.js (rev 0)
+++ trunk/tests/warnings/unexpected_not_in.js 2018-06-13 13:54:50 UTC (rev 386)
@@ -0,0 +1,18 @@
+function unexpected_not_in() {
+ var s, o;
+
+ if (!s in o) { /*warning:unexpected_not_in*/
+ return false;
+ }
+
+ if (!(s in o)) {
+ return false;
+ }
+
+ // Strange, but...if you really want to...
+ if ((!s) in o) {
+ return false;
+ }
+
+ return true;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|