beautifier/js-beautify

Option unescape_strings can produce invalid string literals making JS invalid/uninterpretable

開放

#2,141 建立於 2023年3月17日

 (9 則留言) (0 個反應) (0 位負責人)JavaScript (1,460 個分叉)batch import
good first issuelanguage: javascripttype: bug

倉庫指標

星標
 (8,342 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Description

Option unescape_strings can produce invalid string literals making JS invalid/uninterpretable

Input

The code looked like this before beautification:

        function () {
          i.exports = "\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"
        }()

Expected Output

The code should have looked like this after beautification: code that does not contain invalid string literals

Actual Output

The code actually looked like this after beautification:

        function () {
          i.exports = "\t\n\x0B\f\r   ᠎              

"
        }()

Steps to Reproduce

Environment

OS: Firefox/Win10

Settings

{
        "unescape_strings": true,
}

貢獻者指南