From: Alex Lam S.L Date: Tue, 6 Apr 2021 22:49:12 +0000 (+0100) Subject: preserve compatibility of `quote_style` (#4845) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=73a564343b8231f2278c37c00c444b2cac8e314d;p=UglifyJS.git preserve compatibility of `quote_style` (#4845) --- 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;