[jsinterp] Workaround operator associativity issue

https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1235384480
pull/4829/head
pukkandan 2 years ago
parent 3c7a276234
commit 1a7c9fad9f
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

@ -126,6 +126,10 @@ _NSIG_TESTS = [
'https://www.youtube.com/s/player/c57c113c/player_ias.vflset/en_US/base.js',
'M92UUMHa8PdvPd3wyM', '3hPqLJsiNZx7yA',
),
(
'https://www.youtube.com/s/player/5a3b6271/player_ias.vflset/en_US/base.js',
'B2j7f_UPT4rfje85Lu_e', 'm5DmNymaGQ5RdQ',
),
]

@ -117,8 +117,8 @@ _OPERATORS = { # None => Defined in JSInterpreter._operator
'-': _js_arith_op(operator.sub),
'*': _js_arith_op(operator.mul),
'/': _js_div,
'%': _js_mod,
'/': _js_div,
'**': _js_exp,
}

Loading…
Cancel
Save