diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-04-06 23:49:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 06:49:12 +0800 |
commit | 73a564343b8231f2278c37c00c444b2cac8e314d (patch) | |
tree | 36c842f3ad73c3ef62cfe25df2979a6439fa8d94 | |
parent | 4870747306b6b0111ad6b57af6e59b146991de7d (diff) | |
download | tracifyjs-73a564343b8231f2278c37c00c444b2cac8e314d.tar.gz tracifyjs-73a564343b8231f2278c37c00c444b2cac8e314d.zip |
preserve compatibility of `quote_style` (#4845)
-rw-r--r-- | lib/output.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/output.js b/lib/output.js index e8fd1cfe..ba6785ae 100644 --- a/lib/output.js +++ b/lib/output.js @@ -171,15 +171,15 @@ function OutputStream(options) { } var quote_string = [ - function(str, quote, dq, sq) { - return dq > sq ? quote_single(str) : quote_double(str); - }, + null, quote_single, quote_double, function(str, quote) { return quote == "'" ? quote_single(str) : quote_double(str); }, - ][options.quote_style]; + ][options.quote_style] || function(str, quote, dq, sq) { + return dq > sq ? quote_single(str) : quote_double(str); + }; function make_string(str, quote) { var dq = 0, sq = 0; |