mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-05 20:41:47 -07:00
[jsinterp] Strip /* comments */ when parsing
* NB: _separate() is looking creaky
This commit is contained in:
parent
60835ca16c
commit
f487b4a02a
2 changed files with 27 additions and 3 deletions
|
@ -160,7 +160,6 @@ class TestJSInterpreter(unittest.TestCase):
|
|||
self._test('function f(){var x = 20; x += 30 + 1; return x;}', 51)
|
||||
self._test('function f(){var x = 20; x -= 30 + 1; return x;}', -11)
|
||||
|
||||
@unittest.skip('Not yet fully implemented')
|
||||
def test_comments(self):
|
||||
self._test('''
|
||||
function f() {
|
||||
|
@ -179,6 +178,15 @@ class TestJSInterpreter(unittest.TestCase):
|
|||
}
|
||||
''', 3)
|
||||
|
||||
self._test('''
|
||||
function f() {
|
||||
var x = ( /* 1 + */ 2 +
|
||||
/* 30 * 40 */
|
||||
50);
|
||||
return x;
|
||||
}
|
||||
''', 52)
|
||||
|
||||
def test_precedence(self):
|
||||
self._test('''
|
||||
function f() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue