[javascriptlint-commit] SF.net SVN: javascriptlint:[322] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2013-09-30 21:54:35
|
Revision: 322
http://sourceforge.net/p/javascriptlint/code/322
Author: matthiasmiller
Date: 2013-09-30 21:54:32 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix single-line returns without semicolons.
Modified Paths:
--------------
trunk/jsengine/parser/__init__.py
Added Paths:
-----------
trunk/tests/bugs/one_line_return.js
Modified: trunk/jsengine/parser/__init__.py
===================================================================
--- trunk/jsengine/parser/__init__.py 2013-09-30 21:19:27 UTC (rev 321)
+++ trunk/jsengine/parser/__init__.py 2013-09-30 21:54:32 UTC (rev 322)
@@ -638,7 +638,7 @@
endtoken = t.expect(tok.RETURN)
startpos = endtoken.startpos
- if t.peek_sameline().tok not in (tok.EOF, tok.EOL, tok.SEMI):
+ if t.peek_sameline().tok not in (tok.EOF, tok.EOL, tok.SEMI, tok.RBRACE):
expr = _expression(t, True)
endtoken = expr
else:
Added: trunk/tests/bugs/one_line_return.js
===================================================================
--- trunk/tests/bugs/one_line_return.js (rev 0)
+++ trunk/tests/bugs/one_line_return.js 2013-09-30 21:54:32 UTC (rev 322)
@@ -0,0 +1,2 @@
+function one_line_return() { return } /*warning:missing_semicolon*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|