[javascriptlint-commit] SF.net SVN: javascriptlint:[320] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2013-09-30 21:11:48
|
Revision: 320
http://sourceforge.net/p/javascriptlint/code/320
Author: matthiasmiller
Date: 2013-09-30 21:11:45 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Allow chained assignments in VAR statements.
Modified Paths:
--------------
trunk/javascriptlint/warnings.py
trunk/tests/warnings/equal_as_assign.js
Modified: trunk/javascriptlint/warnings.py
===================================================================
--- trunk/javascriptlint/warnings.py 2013-09-30 21:03:23 UTC (rev 319)
+++ trunk/javascriptlint/warnings.py 2013-09-30 21:11:45 UTC (rev 320)
@@ -324,6 +324,10 @@
@lookfor(tok.ASSIGN)
def equal_as_assign(node):
+ # Allow in VAR statements.
+ if node.parent.parent and node.parent.parent.kind == tok.VAR:
+ return
+
if not node.parent.kind in (tok.SEMI, tok.RESERVED, tok.RP, tok.COMMA,
tok.ASSIGN):
raise LintWarning, node
Modified: trunk/tests/warnings/equal_as_assign.js
===================================================================
--- trunk/tests/warnings/equal_as_assign.js 2013-09-30 21:03:23 UTC (rev 319)
+++ trunk/tests/warnings/equal_as_assign.js 2013-09-30 21:11:45 UTC (rev 320)
@@ -7,4 +7,7 @@
var c;
a = b = c;
+
+ var x, y, z;
+ var w = x = y = z;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|