Fixed an issue in the JavaScript class browser with respect to an empty file. maintenance

Thu, 06 Jul 2017 18:59:43 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 06 Jul 2017 18:59:43 +0200
branch
maintenance
changeset 5790
6411ee48fe91
parent 5781
f4e1fdf3b614
child 5825
9487c08b6a23

Fixed an issue in the JavaScript class browser with respect to an empty file.

Utilities/ClassBrowsers/jsclbr.py file | annotate | diff | comparison | revisions
--- a/Utilities/ClassBrowsers/jsclbr.py	Sun Jul 02 12:13:24 2017 +0200
+++ b/Utilities/ClassBrowsers/jsclbr.py	Thu Jul 06 18:59:43 2017 +0200
@@ -102,7 +102,7 @@
         self.__source = self.__source.replace("\r\n", "\n").replace("\r", "\n")
         
         # ensure source ends with an eol
-        if self.__source[-1] != '\n':
+        if bool(self.__source) and self.__source[-1] != '\n':
             self.__source = self.__source + '\n'
     
     def parse(self):

eric ide

mercurial