diff options
author | sepro <sepro@sepr0.com> | 2025-03-24 22:28:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-24 22:28:47 +0100 |
commit | 9491b44032b330e05bd5eaa546187005d1e8538e (patch) | |
tree | f03348bd9247c796e435e6d63b3abcce37a87c67 /test | |
parent | b7fbb5a0a16a8e8d3e29c29e26ebed677d0d6ea3 (diff) |
[utils] `js_to_json`: Make function less fatal (#12715)
Authored by: seproDev
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 1 |
1 files changed, 1 insertions, 0 deletions
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"') |