[jsinterp] Prevent mis-recognitions of local functions
authorPhilipp Hagemeister <phihag@phihag.de>
Fri, 11 Jul 2014 08:44:56 +0000 (10:44 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 11 Jul 2014 08:44:56 +0000 (10:44 +0200)
youtube_dl/jsinterp.py

index d7e76713f35ba18bca424046977ea5ab53a0f831..3bbb07704128cf1ab27197ca1abbeeaec086b36f 100644 (file)
@@ -99,7 +99,7 @@ class JSInterpreter(object):
 
     def extract_function(self, funcname):
         func_m = re.search(
-            (r'(?:function %s|%s\s*=\s*function)' % (
+            (r'(?:function %s|[{;]%s\s*=\s*function)' % (
                 re.escape(funcname), re.escape(funcname))) +
             r'\((?P<args>[a-z,]+)\){(?P<code>[^}]+)}',
             self.code)