From 94a7bf8521f2611eb2e9e5365cbc2b297240e31e Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Wed, 7 Apr 2021 05:30:02 +0800 Subject: [PATCH] preserve compatibility of `quote_style` --- lib/output.js | 8 ++++---- 1 file 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;