[javascriptlint-commit] SF.net SVN: javascriptlint:[203] trunk/pyjsl/warnings.py
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2008-08-15 14:55:24
|
Revision: 203
http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=203&view=rev
Author: matthiasmiller
Date: 2008-08-15 14:55:20 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
var_hides_arg: implement warning
Modified Paths:
--------------
trunk/pyjsl/warnings.py
Modified: trunk/pyjsl/warnings.py
===================================================================
--- trunk/pyjsl/warnings.py 2008-08-15 14:47:29 UTC (rev 202)
+++ trunk/pyjsl/warnings.py 2008-08-15 14:55:20 UTC (rev 203)
@@ -450,10 +450,17 @@
def legacy_cc_not_understood(node):
pass
-@lookfor()
+@lookfor(tok.NAME)
def var_hides_arg(node):
- pass
+ if node.parent.kind != tok.VAR:
+ return
+ parent = node.parent
+ while parent:
+ if parent.kind == tok.FUNCTION and node.atom in parent.fn_args:
+ raise LintWarning, node
+ parent = parent.parent
+
@lookfor()
def duplicate_formal(node):
pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|