mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[jsinterp] Support alternative function definition form
This commit is contained in:
		| @@ -19,6 +19,9 @@ class TestJSInterpreter(unittest.TestCase): | ||||
|         jsi = JSInterpreter('function x3(){return 42;}') | ||||
|         self.assertEqual(jsi.call_function('x3'), 42) | ||||
|  | ||||
|         jsi = JSInterpreter('var x5 = function(){return 42;}') | ||||
|         self.assertEqual(jsi.call_function('x5'), 42) | ||||
|  | ||||
|     def test_calc(self): | ||||
|         jsi = JSInterpreter('function x4(a){return 2*a+1;}') | ||||
|         self.assertEqual(jsi.call_function('x4', 3), 7) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yen Chi Hsuan
					Yen Chi Hsuan