[javascriptlint-commit] SF.net SVN: javascriptlint:[312] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2013-09-28 04:44:08
|
Revision: 312
http://sourceforge.net/p/javascriptlint/code/312
Author: matthiasmiller
Date: 2013-09-28 04:44:05 +0000 (Sat, 28 Sep 2013)
Log Message:
-----------
#38 case with continue results in 'missing break statement'
Treat CONTINUE as an exit point
Modified Paths:
--------------
trunk/javascriptlint/warnings.py
trunk/tests/warnings/missing_break.js
Modified: trunk/javascriptlint/warnings.py
===================================================================
--- trunk/javascriptlint/warnings.py 2013-09-28 04:30:11 UTC (rev 311)
+++ trunk/javascriptlint/warnings.py 2013-09-28 04:44:05 UTC (rev 312)
@@ -202,6 +202,8 @@
exit_points.add(None)
elif node.kind == tok.BREAK:
exit_points = set([node])
+ elif node.kind == tok.CONTINUE:
+ exit_points = set([node])
elif node.kind == tok.WITH:
exit_points = _get_exit_points(node.kids[-1])
elif node.kind == tok.RETURN:
Modified: trunk/tests/warnings/missing_break.js
===================================================================
--- trunk/tests/warnings/missing_break.js 2013-09-28 04:30:11 UTC (rev 311)
+++ trunk/tests/warnings/missing_break.js 2013-09-28 04:44:05 UTC (rev 312)
@@ -102,5 +102,18 @@
break;
}
+ for (;;) {
+ switch(i) {
+ case 1:
+ i++;
+ continue;
+ case 2:
+ if (i)
+ continue;
+ default: /*warning:missing_break*/
+ break;
+ }
+ }
+
return "";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|