From 73a564343b8231f2278c37c00c444b2cac8e314d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 6 Apr 2021 23:49:12 +0100 Subject: [PATCH] preserve compatibility of `quote_style` (#4845) --- lib/output.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/output.js b/lib/output.js index e8fd1cfe5e8..ba6785aec3f 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;