[jsinterp] Fix bug in operator precedence

Fixes https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1226659543
This commit is contained in:
pukkandan 2022-08-25 09:36:32 +05:30
parent e5458d1d88
commit 164b03c486
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
2 changed files with 5 additions and 1 deletions

View file

@ -114,6 +114,10 @@ _NSIG_TESTS = [
'https://www.youtube.com/s/player/009f1d77/player_ias.vflset/en_US/base.js', 'https://www.youtube.com/s/player/009f1d77/player_ias.vflset/en_US/base.js',
'5dwFHw8aFWQUQtffRq', 'audescmLUzI3jw', '5dwFHw8aFWQUQtffRq', 'audescmLUzI3jw',
), ),
(
'https://www.youtube.com/s/player/dc0c6770/player_ias.vflset/en_US/base.js',
'5EHDMgYLV6HPGk_Mu-kk', 'n9lUJLHbxUI0GQ',
),
] ]

View file

@ -98,8 +98,8 @@ _OPERATORS = { # None => Defined in JSInterpreter._operator
'&': _js_bit_op(operator.and_), '&': _js_bit_op(operator.and_),
'===': operator.is_, '===': operator.is_,
'==': _js_eq_op(operator.eq),
'!==': operator.is_not, '!==': operator.is_not,
'==': _js_eq_op(operator.eq),
'!=': _js_eq_op(operator.ne), '!=': _js_eq_op(operator.ne),
'<=': _js_comp_op(operator.le), '<=': _js_comp_op(operator.le),