aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_jsinterp.py
diff options
context:
space:
mode:
authordirkf <[email protected]>2024-12-12 04:21:53 +0000
committerdirkf <[email protected]>2024-12-16 12:38:51 +0000
commitf487b4a02a74bb143a7b8f7cb26819b5b661a40b (patch)
treeb9f84a4b972813ebd9d56fe079841550af9cf581 /test/test_jsinterp.py
parent60835ca16c052eb00bb9bccd44f8843edac66a2e (diff)
downloadyoutube-dl-f487b4a02a74bb143a7b8f7cb26819b5b661a40b.tar.gz
youtube-dl-f487b4a02a74bb143a7b8f7cb26819b5b661a40b.zip
[jsinterp] Strip /* comments */ when parsing
* NB: _separate() is looking creaky
Diffstat (limited to 'test/test_jsinterp.py')
-rw-r--r--test/test_jsinterp.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py
index 07ed481d8..12e7b9b94 100644
--- a/test/test_jsinterp.py
+++ b/test/test_jsinterp.py
@@ -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() {