Bug 715791 - Preserve line numbers when preprocessing java files as well as js files. r=ted
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 05 Jan 2012 23:32:05 -0500
changeset 84102 4796cf23c294a2d11b9dd302fbc3392c7d0248d7
parent 84101 d58132b4ecc400ab71e5971d606775eba3a732cf
child 84103 a0fb6ed985c669b3d641186097ff735222e7464c
push id4739
push userkgupta@mozilla.com
push dateTue, 10 Jan 2012 15:03:47 +0000
treeherdermozilla-inbound@4796cf23c294 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs715791
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 715791 - Preserve line numbers when preprocessing java files as well as js files. r=ted
config/Preprocessor.py
js/src/config/Preprocessor.py
--- a/config/Preprocessor.py
+++ b/config/Preprocessor.py
@@ -423,17 +423,17 @@ class Preprocessor:
     if isName:
       try:
         args = str(args)
         if not os.path.isabs(args):
           args = os.path.join(self.context['DIRECTORY'], args)
         args = open(args, 'rU')
       except:
         raise Preprocessor.Error(self, 'FILE_NOT_FOUND', str(args))
-    self.checkLineNumbers = bool(re.search('\.js(?:\.in)?$', args.name))
+    self.checkLineNumbers = bool(re.search('\.(js|java)(?:\.in)?$', args.name))
     oldFile = self.context['FILE']
     oldLine = self.context['LINE']
     oldDir = self.context['DIRECTORY']
     if args.isatty():
       # we're stdin, use '-' and '' for file and dir
       self.context['FILE'] = '-'
       self.context['DIRECTORY'] = ''
     else:
--- a/js/src/config/Preprocessor.py
+++ b/js/src/config/Preprocessor.py
@@ -423,17 +423,17 @@ class Preprocessor:
     if isName:
       try:
         args = str(args)
         if not os.path.isabs(args):
           args = os.path.join(self.context['DIRECTORY'], args)
         args = open(args, 'rU')
       except:
         raise Preprocessor.Error(self, 'FILE_NOT_FOUND', str(args))
-    self.checkLineNumbers = bool(re.search('\.js(?:\.in)?$', args.name))
+    self.checkLineNumbers = bool(re.search('\.(js|java)(?:\.in)?$', args.name))
     oldFile = self.context['FILE']
     oldLine = self.context['LINE']
     oldDir = self.context['DIRECTORY']
     if args.isatty():
       # we're stdin, use '-' and '' for file and dir
       self.context['FILE'] = '-'
       self.context['DIRECTORY'] = ''
     else: