Skip to content

Commit fc040bf

Browse files
committed
[jsinterp] Prevent mis-recognitions of local functions
1 parent c8bf86d commit fc040bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

youtube_dl/jsinterp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def interpret_expression(self, expr, local_vars, allow_recursion):
9999

100100
def extract_function(self, funcname):
101101
func_m = re.search(
102-
(r'(?:function %s|%s\s*=\s*function)' % (
102+
(r'(?:function %s|[{;]%s\s*=\s*function)' % (
103103
re.escape(funcname), re.escape(funcname))) +
104104
r'\((?P<args>[a-z,]+)\){(?P<code>[^}]+)}',
105105
self.code)

0 commit comments

Comments
 (0)