[JSInterp] Fix bit-shift coercion for player 9c6dfc4a

This commit is contained in:
dirkf 2025-02-06 21:09:00 +00:00
parent 26b6f15d14
commit 711e72c292
4 changed files with 34 additions and 6 deletions

View file

@ -459,6 +459,10 @@ class TestJSInterpreter(unittest.TestCase):
self._test('function f(){return undefined >> 5}', 0)
self._test('function f(){return 42 << NaN}', 42)
self._test('function f(){return 42 << Infinity}', 42)
self._test('function f(){return 0.0 << null}', 0)
self._test('function f(){return NaN << 42}', 0)
self._test('function f(){return "21.9" << 1}', 42)
self._test('function f(){return 21 << 4294967297}', 42)
def test_negative(self):
self._test('function f(){return 2 * -2.0 ;}', -4)

View file

@ -219,6 +219,10 @@ _NSIG_TESTS = [
'https://www.youtube.com/s/player/2f1832d2/player_ias.vflset/en_US/base.js',
'YWt1qdbe8SAfkoPHW5d', 'RrRjWQOJmBiP',
),
(
'https://www.youtube.com/s/player/9c6dfc4a/player_ias.vflset/en_US/base.js',
'jbu7ylIosQHyJyJV', 'uwI0ESiynAmhNg',
),
]