[jsinterp] Fix for youtube player c81bbb4a

This commit is contained in:
pukkandan 2022-08-16 06:53:45 +05:30
parent 5c6d2ef9d1
commit 6d3e7424bf
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
3 changed files with 24 additions and 15 deletions

View file

@ -212,6 +212,11 @@ class TestJSInterpreter(unittest.TestCase):
''')
self.assertEqual(jsi.call_function('x'), 7)
jsi = JSInterpreter('''
function x() { return (l=[0,1,2,3], function(a, b){return a+b})((l[1], l[2]), l[3]) }
''')
self.assertEqual(jsi.call_function('x'), 5)
def test_void(self):
jsi = JSInterpreter('''
function x() { return void 42; }

View file

@ -102,6 +102,10 @@ _NSIG_TESTS = [
'https://www.youtube.com/s/player/4c3f79c5/player_ias.vflset/en_US/base.js',
'TDCstCG66tEAO5pR9o', 'dbxNtZ14c-yWyw',
),
(
'https://www.youtube.com/s/player/c81bbb4a/player_ias.vflset/en_US/base.js',
'gre3EcLurNY2vqp94', 'Z9DfGxWP115WTg',
),
]