preserve compatibility of quote_style (#4845)

This commit is contained in:
Alex Lam S.L 2021-04-06 23:49:12 +01:00 committed by GitHub
parent 4870747306
commit 73a564343b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;