From 9491b44032b330e05bd5eaa546187005d1e8538e Mon Sep 17 00:00:00 2001 From: sepro Date: Mon, 24 Mar 2025 22:28:47 +0100 Subject: [utils] `js_to_json`: Make function less fatal (#12715) Authored by: seproDev --- test/test_utils.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test/test_utils.py') diff --git a/test/test_utils.py b/test/test_utils.py index 42dc7f937..e60ceed8f 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1260,6 +1260,7 @@ class TestUtil(unittest.TestCase): def test_js_to_json_malformed(self): self.assertEqual(js_to_json('42a1'), '42"a1"') self.assertEqual(js_to_json('42a-1'), '42"a"-1') + self.assertEqual(js_to_json('{a: `${e("")}`}'), '{"a": "\\"e\\"(\\"\\")"}') def test_js_to_json_template_literal(self): self.assertEqual(js_to_json('`Hello ${name}`', {'name': '"world"'}), '"Hello world"') -- cgit v1.2.3