1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[jsinterp] Prevent mis-recognitions of local functions

This commit is contained in:
Philipp Hagemeister 2014-07-11 10:44:56 +02:00
parent c8bf86d50d
commit fc040bfd05

View file

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