[javascriptlint-commit] SF.net SVN: javascriptlint:[293] trunk
Status: Beta
Brought to you by:
matthiasmiller
From: <mat...@us...> - 2009-11-18 12:20:04
|
Revision: 293 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=293&view=rev Author: matthiasmiller Date: 2009-11-18 12:19:50 +0000 (Wed, 18 Nov 2009) Log Message: ----------- #2891908: Fix exception when using finally without catch. Patch submitted on tracker. Modified Paths: -------------- trunk/javascriptlint/warnings.py Added Paths: ----------- trunk/tests/bugs/sf-2891908-finally_without_catch.js Modified: trunk/javascriptlint/warnings.py =================================================================== --- trunk/javascriptlint/warnings.py 2009-11-18 12:15:40 UTC (rev 292) +++ trunk/javascriptlint/warnings.py 2009-11-18 12:19:50 UTC (rev 293) @@ -193,15 +193,19 @@ elif node.kind == tok.TRY: try_, catch_, finally_ = node.kids - assert catch_.kind == tok.RESERVED - catch_, = catch_.kids - assert catch_.kind == tok.LEXICALSCOPE - catch_, = catch_.kids - assert catch_.kind == tok.CATCH - ignored, ignored, catch_ = catch_.kids - assert catch_.kind == tok.LC + exit_points = _get_exit_points(try_) - exit_points = _get_exit_points(try_) | _get_exit_points(catch_) + if catch_: + assert catch_.kind == tok.RESERVED + catch_, = catch_.kids + assert catch_.kind == tok.LEXICALSCOPE + catch_, = catch_.kids + assert catch_.kind == tok.CATCH + ignored, ignored, catch_ = catch_.kids + assert catch_.kind == tok.LC + + exit_points |= _get_exit_points(catch_) + if finally_: finally_exit_points = _get_exit_points(finally_) if None in finally_exit_points: Added: trunk/tests/bugs/sf-2891908-finally_without_catch.js =================================================================== --- trunk/tests/bugs/sf-2891908-finally_without_catch.js (rev 0) +++ trunk/tests/bugs/sf-2891908-finally_without_catch.js 2009-11-18 12:19:50 UTC (rev 293) @@ -0,0 +1,8 @@ +function f() { + try { + /*jsl:pass*/ + } + finally { + /*jsl:pass*/ + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |