Plugins/CheckerPlugins/SyntaxChecker/jsCheckSyntax.py

changeset 5849
512001065055
parent 5762
76ef5f340007
child 6048
82ad8ec9548c
diff -r 56388f41b1e6 -r 512001065055 Plugins/CheckerPlugins/SyntaxChecker/jsCheckSyntax.py
--- a/Plugins/CheckerPlugins/SyntaxChecker/jsCheckSyntax.py	Sat Aug 26 16:49:16 2017 +0200
+++ b/Plugins/CheckerPlugins/SyntaxChecker/jsCheckSyntax.py	Sat Aug 26 17:10:43 2017 +0200
@@ -188,5 +188,10 @@
         cline = min(len(codestring.splitlines()), int(line)) - 1
         code = codestring.splitlines()[cline]
         return [{'error': (fn, int(line), 0, code, error)}]
+    except IndexError:
+        error = "Incomplete source file"
+        splittedCode = codestring.splitlines()
+        return [{'error': (file, len(splittedCode) + 1, len(splittedCode[-1]),
+                           splittedCode[-1], error)}]
     
     return [{}]

eric ide

mercurial